Skip to content

feat(next): group-array field support #177

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

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

lukad
Copy link
Collaborator

@lukad lukad commented May 2, 2025

This adds support for generating fields for {"type":"array"} schemas which includes:

  • group-arrays (an array schema where the items subschema is an object schema)
  • array schemas where the items subschema is anything else e.g. {"type": "array", "items": {"type": "string}}

}

if (schema.description !== undefined) {
field.description = schema.description
Copy link
Collaborator

Choose a reason for hiding this comment

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

bug: We should spread all schema keys (except items) down to field, why did you decide to not do it?
For example, if I pass x-foo, it will be ignored by JSF.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good catch, that was not intentional. I've just pushed a change that reuses the same logic for propagating schema props to fields while excluding certain keywords.

@lukad lukad changed the title initial group-array field support feat(next): group-array field support May 8, 2025
lukad added 2 commits May 8, 2025 17:43
This also simplifies field generation a bit by removing the object
special case as well as the array special case which
@lukad lukad force-pushed the devxp-2540-group-array-fields branch from 41d63be to 541f8ee Compare May 8, 2025 15:44
@lukad lukad marked this pull request as ready for review May 9, 2025 15:32
@lukad lukad requested review from eng-almeida and dragidavid May 9, 2025 15:32
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