Skip to content

Enhance array properties with item type metadata and nested structures#163

Merged
andrii-balitskyi merged 14 commits intomainfrom
array-property-item
Mar 5, 2025
Merged

Enhance array properties with item type metadata and nested structures#163
andrii-balitskyi merged 14 commits intomainfrom
array-property-item

Conversation

@andrii-balitskyi
Copy link
Copy Markdown
Contributor

No description provided.

@vercel
Copy link
Copy Markdown

vercel bot commented Feb 26, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
blueprint ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 5, 2025 1:51pm

Copy link
Copy Markdown
Member

@razor-x razor-x left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neat!

interface ListProperty extends BaseProperty {
format: 'list'
jsonType: 'array'
itemFormat?: Property['format'] | 'discriminated_object'
Copy link
Copy Markdown
Member

@razor-x razor-x Feb 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of all of these optional values, we should follow the pattern already established by properly defining what kind of array properties we expect.

interface StringListProperty extends ListProperty {
  itemFormat: 'string'
}

interface NumberListProperty extends ListProperty {
  itemFormat: 'number'
}

interface EnumListProperty extends ListProperty {
  itemFormat: 'enum'
  itemsValues: EnumValue[]
}

interface ObjectListProperty extends ListProperty {
  itemFormat: 'object'
  itemProperties: Property[]
}

interface DiscriminatedListProperty extends ListProperty {
  itemFormat: 'object'
	itemDiscriminatorKey: string
  itemVariants: Array<{
    variantName: string // the discriminator value
    properties: Property[]
    description: string
  }>
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

razor-x and others added 4 commits February 28, 2025 13:22
* Move Seam extensions into seam.js

* feat: Allow null routePath for some resources

* ci: Format code

* Move pagination to blueprint

* Add pagination to fixture

* ci: Generate code

* ci: Format code

* Make pagination nullable

* Add createPagination

* ci: Generate code

* Implement createPagination

* Implement hasPagination

* Update src/lib/blueprint.ts

* Use responseKey over paginationResponseKey

* ci: Generate code

* Use paginationResponseKey via openapi.components.schemas

* Update fixture

---------

Co-authored-by: Seam Bot <seambot@getseam.com>
Co-authored-by: Evan Sosenko <evan@getseam.com>
@andrii-balitskyi andrii-balitskyi merged commit 460c611 into main Mar 5, 2025
21 checks passed
@andrii-balitskyi andrii-balitskyi deleted the array-property-item branch March 5, 2025 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants