-
Notifications
You must be signed in to change notification settings - Fork 0
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Neat!
src/lib/blueprint.ts
Outdated
@@ -251,6 +251,15 @@ interface RecordProperty extends BaseProperty { | |||
interface ListProperty extends BaseProperty { | |||
format: 'list' | |||
jsonType: 'array' | |||
itemFormat?: Property['format'] | 'discriminated_object' |
There was a problem hiding this comment.
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
}>
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* 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>
…164) Co-authored-by: Seam Bot <seambot@getseam.com>
Co-authored-by: Evan Sosenko <evan@getseam.com>
No description provided.