Skip to content

Commit

Permalink
fix: Add resource description (#65)
Browse files Browse the repository at this point in the history
* Add resource.description

* Update test snapshots

* Add description to the fixture resource foo

* ci: Format code

* fix: Correctly determine resource property format (#66)

* Add format to PropertySchema to correctly determine resource property format

* Update test snapshots

---------

Co-authored-by: Seam Bot <[email protected]>
  • Loading branch information
andrii-balitskyi and seambot authored Aug 26, 2024
1 parent ec65c43 commit 0e3e9eb
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lib/blueprint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export interface Route {
export interface Resource {
resourceType: string
properties: Property[]
description: string
}

export interface Namespace {
Expand Down Expand Up @@ -393,6 +394,7 @@ const createResources = (
[schemaName]: {
resourceType: schemaName,
properties: createProperties(schema.properties),
description: schema.description ?? '',
},
}
}
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/types/openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export default {
schemas: {
foo: {
type: 'object',
description: 'A foo resource.',
properties: {
foo_id: {
description: 'Foo id',
Expand Down
1 change: 1 addition & 0 deletions test/snapshots/blueprint.test.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Generated by [AVA](https://avajs.dev).
{
resources: {
foo: {
description: 'A foo resource.',
properties: [
{
deprecationMessage: '',
Expand Down
Binary file modified test/snapshots/blueprint.test.ts.snap
Binary file not shown.
1 change: 1 addition & 0 deletions test/snapshots/seam-blueprint.test.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: '',
Expand Down
Binary file modified test/snapshots/seam-blueprint.test.ts.snap
Binary file not shown.

0 comments on commit 0e3e9eb

Please sign in to comment.