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

Uint8 format lead to macro error #996

Closed
so-schen opened this issue Aug 23, 2024 · 1 comment · Fixed by #1012
Closed

Uint8 format lead to macro error #996

so-schen opened this issue Aug 23, 2024 · 1 comment · Fixed by #1012

Comments

@so-schen
Copy link

so-schen commented Aug 23, 2024

version v4.2.2

utoipa = { version = "4.2", features = ["preserve_order", "non_strict_integers"] }

error: unexpected format: UInt8, expected one of: Int32, Int64, Float, Double, Byte, Binary, Date, DateTime, Password
--> sosmr/src/lifecycle/epoch_id.rs:42:23
|
42 | #[schema(format = UInt8)]

@juhaku
Copy link
Owner

juhaku commented Aug 31, 2024

@so-schen Ah, it seems that the parsing side of the format for non strict integers has never been implemented. I'll fix this.

juhaku added a commit that referenced this issue Aug 31, 2024
Prior to this PR the schema `format = ...` attribute was missing support
for `non_strict_integers` feature flag enabled formats. This commit adds
support for those formats.

E.g. now the following will work if `non_strict_integers` feature flag
is enabled.
```rust
struct Numbers {
    #[schema(format = UInt8)]
    ui8: String,
}
```

Fixes #996
juhaku added a commit that referenced this issue Aug 31, 2024
Prior to this PR the schema `format = ...` attribute was missing support
for `non_strict_integers` feature flag enabled formats. This commit adds
support for those formats.

E.g. now the following will work if `non_strict_integers` feature flag
is enabled.
```rust
struct Numbers {
    #[schema(format = UInt8)]
    ui8: String,
}
```

Fixes #996
juhaku added a commit that referenced this issue Aug 31, 2024
Prior to this PR the schema `format = ...` attribute was missing support
for `non_strict_integers` feature flag enabled formats. This commit adds
support for those formats.

E.g. now the following will work if `non_strict_integers` feature flag
is enabled.
```rust
struct Numbers {
    #[schema(format = UInt8)]
    ui8: String,
}
```

Fixes #996
juhaku added a commit that referenced this issue Aug 31, 2024
Prior to this PR the schema `format = ...` attribute was missing support
for `non_strict_integers` feature flag enabled formats. This commit adds
support for those formats.

E.g. now the following will work if `non_strict_integers` feature flag
is enabled.
```rust
struct Numbers {
    #[schema(format = UInt8)]
    ui8: String,
}
```

Fixes #996
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants