diff --git a/src/lib/blueprint.ts b/src/lib/blueprint.ts index 5d42ee7..3e8c752 100644 --- a/src/lib/blueprint.ts +++ b/src/lib/blueprint.ts @@ -31,6 +31,7 @@ export interface Route { export interface Resource { resourceType: string properties: Property[] + description: string } export interface Namespace { @@ -393,6 +394,7 @@ const createResources = ( [schemaName]: { resourceType: schemaName, properties: createProperties(schema.properties), + description: schema.description ?? '', }, } } diff --git a/test/fixtures/types/openapi.ts b/test/fixtures/types/openapi.ts index 72aa8ce..a48af70 100644 --- a/test/fixtures/types/openapi.ts +++ b/test/fixtures/types/openapi.ts @@ -7,6 +7,7 @@ export default { schemas: { foo: { type: 'object', + description: 'A foo resource.', properties: { foo_id: { description: 'Foo id', diff --git a/test/snapshots/blueprint.test.ts.md b/test/snapshots/blueprint.test.ts.md index 634023f..04d368f 100644 --- a/test/snapshots/blueprint.test.ts.md +++ b/test/snapshots/blueprint.test.ts.md @@ -11,6 +11,7 @@ Generated by [AVA](https://avajs.dev). { resources: { foo: { + description: 'A foo resource.', properties: [ { deprecationMessage: '', diff --git a/test/snapshots/blueprint.test.ts.snap b/test/snapshots/blueprint.test.ts.snap index 0eab834..14aab88 100644 Binary files a/test/snapshots/blueprint.test.ts.snap and b/test/snapshots/blueprint.test.ts.snap differ diff --git a/test/snapshots/seam-blueprint.test.ts.md b/test/snapshots/seam-blueprint.test.ts.md index 17c4f20..0098227 100644 --- a/test/snapshots/seam-blueprint.test.ts.md +++ b/test/snapshots/seam-blueprint.test.ts.md @@ -11,6 +11,7 @@ Generated by [AVA](https://avajs.dev). { resources: { acs_system: { + description: 'Represents an [access control system](https://docs.seam.co/latest/capability-guides/access-systems).', properties: [ { deprecationMessage: '', diff --git a/test/snapshots/seam-blueprint.test.ts.snap b/test/snapshots/seam-blueprint.test.ts.snap index 172d9a6..82003fe 100644 Binary files a/test/snapshots/seam-blueprint.test.ts.snap and b/test/snapshots/seam-blueprint.test.ts.snap differ