-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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] (Re-)Adding support for rust-server #290
[rust-server] (Re-)Adding support for rust-server #290
Conversation
@wing328 - opening as you suggested. The first issue above is the one currently causing the most problems. |
|
||
pub struct ArrayOfArrayOfNumberOnly(object); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm. Have been looking into the missing objects with a single property. I've added some logs that catch them as they pass through postProcessModels
(printing out the datatype):
[main] WARN o.o.c.languages.RustServerCodegen - Found a disappearing model: OuterNumber(OuterNumber), number
[main] WARN o.o.c.languages.RustServerCodegen - Found a disappearing model: ArrayOfNumberOnly(ArrayOfNumberOnly), object
[main] WARN o.o.c.languages.RustServerCodegen - Found a disappearing model: EnumClass(EnumClass), string
[main] WARN o.o.c.languages.RustServerCodegen - Found a disappearing model: List(List), object
[main] WARN o.o.c.languages.RustServerCodegen - Found a disappearing model: NumberOnly(NumberOnly), object
It looks as if those with datatype object
turn up in models.rs
with the datatype object
, whilst those with other datatypes just disappear...
OK - models with variables now seem to be working correctly. Models without properties, though, are still troublesome. It looks as if they're going missing between |
Ah-ha! It looks like the single-property models have I'm not sure what the correct solution is, but I think I can get something working by setting |
Currently not working:
However, those aside, we now produce code that compiles correctly. I think I'm now out of time to resolve the gaps for the moment, however. I'll tidy this up so that this could be merged as a barely acceptable initial effort. |
We've commented out a few bits that rust-server doesn't yet support
And finally get rid of the generation date in the sample
Right. I think this is now in an acceptable state to get merged in (assuming CI passes). This PR allows I'm proposing to merge this PR in its current state, however, since it does work for most mainline cases, and so may be useful in itself, and also as a starting point for other people to work off. I'm also almost out of time to work on Once merged, I'll create an issue detailing all the known outstanding work required. Technical committee: @frol @farcaller |
FYI. The CI failures have nothing to do with the change in this PR. |
I've reviewed the change, which looks good to me. I'll submit a PR later for enhancements, e.g. check for model/object in CodegenParameter, |
PR checklist
./bin/
to update Petstore sample so that CIs can verify the change. (For instance, only need to run./bin/{LANG}-petstore.sh
and./bin/security/{LANG}-petstore.sh
if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in.\bin\windows\
.master
,3.1.x
,4.0.x
. Default:master
.Description of the PR
This is an initial attempt at getting
rust-server
working in openapi-generator (and therefore fix #111).Thanks to @wing328 and @mirw for their help with this.
Outstanding issues:
schema: {type: string}