Skip to content

Named validation/transformation also changes JSON Schema title#43

Open
ysangkok wants to merge 3 commits intomainfrom
transform-title
Open

Named validation/transformation also changes JSON Schema title#43
ysangkok wants to merge 3 commits intomainfrom
transform-title

Conversation

@ysangkok
Copy link
Contributor

@ysangkok ysangkok commented Feb 13, 2026

transformNamed will inline the wrapped schema in the emitted JSON.
It is however unintuitive that the title of the wrapped object is not updated,
since it could come from e.g. unionNamed.
One would expect that the outer name would override the inner one.

Since transformNamed will inline the wrapped object, it is inintuitive
that the title of the wrapped object is not updated, since it could come
from e.g. unionNamed. One would expect that the outer name would
override the inner one.
Copy link
Member

@qxjit qxjit left a comment

Choose a reason for hiding this comment

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

❤️ Thank you!

One tiny request I added, but this is a nice fix.

, schemaComponents = components
, openApiSchema =
(openApiSchema schemaInfo)
{ OpenApi._schemaTitle = Just $ fleeceNameToOpenApiKey name
Copy link
Member

Choose a reason for hiding this comment

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

To make sure we keep matching the openApiKey value above we should extract the key to a let binding and then use it for both openApiKey and _schemaTitle

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, I have pushed a commit to address this.

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.

2 participants