Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 14 commits into from
Mar 5, 2025

Conversation

andrii-balitskyi
Copy link
Contributor

No description provided.

Copy link

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
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!

@@ -251,6 +251,15 @@ interface RecordProperty extends BaseProperty {
interface ListProperty extends BaseProperty {
format: 'list'
jsonType: 'array'
itemFormat?: Property['format'] | 'discriminated_object'
Copy link
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
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