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

Fix Schema as additional properties #580

Merged
merged 1 commit into from
Apr 15, 2023

Conversation

juhaku
Copy link
Owner

@juhaku juhaku commented Apr 15, 2023

This PR adds support for unit types used as additional properties of a Schema. Prior to this commit following declarations was not possible because unit type () is resolved to Schema directly and it was not possible to convert it to additional properties.

 #[derive(ToSchema)]
 struct Container {
     volumes: HashMap<String, HashMap<(), ()>>
 }

Fixes #576

This PR adds support for unit types used as additional properties of a
Schema. Prior to this commit following declarations was not possible
because unit type _`()`_ is resolved to `Schema` directly and it was not
possible to convert it to additional properties.
```rust
 #[derive(ToSchema)]
 struct Container {
     volumes: HashMap<String, HashMap<(), ()>>
 }
```
@juhaku juhaku merged commit 1abced1 into master Apr 15, 2023
@juhaku juhaku deleted the fix-schema-as-additional-properties branch April 15, 2023 17:09
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.

Accept HashMap<(), ()> as object
1 participant