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

[rust-server] unable to handle >32 regexes #314

Closed
bjgill opened this issue Jun 14, 2018 · 1 comment
Closed

[rust-server] unable to handle >32 regexes #314

bjgill opened this issue Jun 14, 2018 · 1 comment

Comments

@bjgill
Copy link
Contributor

bjgill commented Jun 14, 2018

Description

See swagger-api/swagger-codegen#8201 (comment) - if the swagger spec has more than 32 regexes, we generate invalid Rust. This is because we generate a tuple/fixed length slice(?), and the Rust standard library only copes with tuples/fixed length slices(?) up to size 32.

We should fix this and then add a test.

(Note: this part of a set of issues from swagger-codegen. I didn't fix this as part of the move to openapi-generator. Thus I strongly suspect rust-server in openapi-generator also suffers the same problem. I'm not planning on working on this at the moment - contributions gratefully welcomed)

openapi-generator version
OpenAPI declaration file content or url
Command line used for generation
Steps to reproduce
Related issues/PRs
Suggest a fix/enhancement

I suspect the fix will be to stop using tuples/fixed length slices. Instead, maybe a Vec might work? It'll be a bit less efficient, but I don't think that will have a significant effect.

Testing this may be fun. I'd recommend starting to split up the test samples for rust-server. That way, we can have a spec that just tests for this issue, without ending up with a single test spec of absurd length.

@richardwhiuk
Copy link
Contributor

Fixed by #3494

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants