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(actix): support parsing arrays for schemas #531

Merged
merged 1 commit into from
Sep 10, 2024
Merged

Conversation

tiagolobocastro
Copy link
Collaborator

Array field types were not being parsed.
Also in this case errors were not being handled gracefully.

Resolves #454

Array field types were not being parsed.
Also in this case errors were not being handled gracefully.

Signed-off-by: Tiago Castro <[email protected]>
@tiagolobocastro
Copy link
Collaborator Author

@sireaev this should fix it.
@formlogic-kirk seems arrays were not being handled properly, would you mind taking a look at this fix?

@@ -1491,7 +1493,10 @@ fn handle_unnamed_field_struct(
continue;
}

let ty_ref = get_field_type(field);
let ty_ref = match get_field_type(field) {
Copy link
Contributor

Choose a reason for hiding this comment

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

good place for let-else if that's allowed by the msrv

Copy link
Collaborator Author

@tiagolobocastro tiagolobocastro Sep 10, 2024

Choose a reason for hiding this comment

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

hmm seems that it depends on the imported crates
With my lockfile it's 1.60 but if I delete it it's 1.65 due to:

┌─────────────────────────────────────────────────────────────────────
│ error: package hashbrown v0.14.5 cannot be built because it requires rustc 1.63.0 or newer, while the currently active rustc version is 1.62.1 │
│ error: package serde_yaml v0.9.34+deprecated cannot be built because it requires rustc 1.64 or newer, while the currently active rustc version is 1.63.0 │
│ error: package regex-automata v0.4.7 cannot be built because it requires rustc 1.65 or newer, while the currently active rustc version is 1.64.0 │
└────────────────────────────────────────────────────────────────

Copy link
Contributor

Choose a reason for hiding this comment

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

Fair enough. The MSRV aware resolver can't come soon enough

Copy link
Contributor

@formlogic-kirk formlogic-kirk left a comment

Choose a reason for hiding this comment

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

That looks good to me. I need to revisit the maps and see if this is happening for the value types there also

@tiagolobocastro tiagolobocastro merged commit e04adff into master Sep 10, 2024
7 checks passed
@tiagolobocastro tiagolobocastro deleted the arrays branch September 10, 2024 18:14
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.

Arrays are not supported
2 participants