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

Chore enhance generic schema collection #1116

Merged
merged 1 commit into from
Oct 12, 2024
Merged

Conversation

juhaku
Copy link
Owner

@juhaku juhaku commented Oct 12, 2024

This commit enhances generic schema collection from generic arguments for pre defined set of container types. Prior to this commit if the generic argument was one of known container types like Vec or LinkedList then types within that container type was not correctly composed. This commit addresses this allowing better compose ability.

This commit changes the auto collect of schemas to only collect non inlined schemas from their usage. This results leaner OpenAPI document by avoid polluting the OpenAPI document from unrelated schemas (which are not used by referencing). This behavior can be altered with utoipa-config by setting SchemaCollect::All mode on which will return to old behavior of collecting also inlined schemas.

Closes #1114

@juhaku juhaku force-pushed the chore-schema-collect-fix branch from c9c1fd0 to 1e00932 Compare October 12, 2024 13:39
This commit enhances generic schema collection from generic arguments
for pre defined set of container types. Prior to this commit if the
generic argument was one of known container types like `Vec` or
`LinkedList` then types within that container type was not correctly
composed. This commit addresses this allowing better compose ability.

This commit changes the auto collect of schemas to only collect non
inlined schemas from their usage. This results leaner OpenAPI document
by avoid polluting the OpenAPI document from unrelated schemas (which
are not used by referencing). This behavior can be altered with
`utoipa-config` by setting `SchemaCollect::All` mode on which will
return to old behavior of collecting also inlined schemas.

Closes #1114
@juhaku juhaku force-pushed the chore-schema-collect-fix branch from 1e00932 to 1dc9cd1 Compare October 12, 2024 13:40
@juhaku juhaku merged commit 449b164 into master Oct 12, 2024
22 checks passed
@juhaku juhaku deleted the chore-schema-collect-fix branch October 12, 2024 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Released
Development

Successfully merging this pull request may close these issues.

[5.0.0-rc.0] inlined types shouldn't be included in automatic schema collection
1 participant