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

[FEATURE] Json Schema - Include uniqueItems when array is created from Set #3441

Closed
michalbogacz opened this issue Jan 5, 2024 · 0 comments · Fixed by #3604
Closed

[FEATURE] Json Schema - Include uniqueItems when array is created from Set #3441

michalbogacz opened this issue Jan 5, 2024 · 0 comments · Fixed by #3604
Assignees

Comments

@michalbogacz
Copy link

Tapir version: 1.9.6

Scala version: Any

Describe the bug

Schema description for Arrays does not include uniqueItems even if it's created from Set[].
For reference https://json-schema.org/understanding-json-schema/reference/array#uniqueItems

This feature is useful to know API is returning array of unique elements and there is no need to deduplicate.

How to reproduce?

In current version create schema with Set type field (and e.g. enum). Result:

"SetWithEnums" : {
    "type" : "array",
    "items" : {
        "$ref" : "#/$defs/MyEnum"
    }
}

Additional information

This feature is supported in https://github.com/andyglow/scala-jsonschema

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 a pull request may close this issue.

2 participants