diff --git a/pkg/server/router/schema_test.go b/pkg/server/router/schema_test.go index 031e06af9..4c83b4955 100644 --- a/pkg/server/router/schema_test.go +++ b/pkg/server/router/schema_test.go @@ -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" @@ -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()) diff --git a/pkg/service/schema/service.go b/pkg/service/schema/service.go index f407da713..c170cf79e 100644 --- a/pkg/service/schema/service.go +++ b/pkg/service/schema/service.go @@ -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, }) }