Skip to content
This repository has been archived by the owner on Dec 12, 2024. It is now read-only.

Commit

Permalink
fixing schema type error (#530)
Browse files Browse the repository at this point in the history
* fixing schema type error

* credschema
  • Loading branch information
nitro-neal authored Jun 9, 2023
1 parent 777620f commit 7710974
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions pkg/server/router/schema_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"testing"

credschema "github.com/TBD54566975/ssi-sdk/credential/schema"
"github.com/stretchr/testify/assert"

"github.com/tbd54566975/ssi-service/config"
Expand Down Expand Up @@ -98,6 +99,7 @@ func TestSchemaRouter(t *testing.T) {
assert.NotEmpty(tt, createdSchema)
assert.NotEmpty(tt, createdSchema.ID)
assert.Equal(tt, "simple schema 2", createdSchema.Schema.Name())
assert.Equal(tt, credschema.JSONSchema2023Type, createdSchema.Type)

// get all schemas, expect two
gotSchemas, err = schemaService.ListSchemas(context.Background())
Expand Down
6 changes: 4 additions & 2 deletions pkg/service/schema/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,10 @@ func (s Service) ListSchemas(ctx context.Context) (*ListSchemasResponse, error)
schemas := make([]GetSchemaResponse, 0, len(storedSchemas))
for _, stored := range storedSchemas {
schemas = append(schemas, GetSchemaResponse{
ID: stored.ID,
Schema: stored.Schema,
ID: stored.ID,
Type: stored.Type,
Schema: stored.Schema,
CredentialSchema: stored.CredentialSchema,
})
}

Expand Down

0 comments on commit 7710974

Please sign in to comment.