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

bad results when using multiple Rust types with the same name #383

Open
davepacheco opened this issue Jun 23, 2022 · 0 comments
Open

bad results when using multiple Rust types with the same name #383

davepacheco opened this issue Jun 23, 2022 · 0 comments

Comments

@davepacheco
Copy link
Collaborator

In oxidecomputer/omicron#1210 I saw a case where we had multiple Rust types with the same name (well, in different modules) -- one was used as an input type and one as an output type. Only one of these made it into the OpenAPI spec. It seems like this could result in all kinds of bad behavior. For example, suppose type A is used in the spec where type B was meant. At best, if B is an input type, and the types are totally different, then every request that used type B as input would probably fail validation and there'd be no way to call them (using a spec-generated client). At worst, if the types are similar but type B has an optional field that's not in type A, dropshot would be silently corrupting data on input (silently deleting a field from the struct). I think you could have the same thing on output.

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

No branches or pull requests

1 participant