Skip to content

Conversation

@azriel-healthpoint
Copy link
Contributor

@azriel-healthpoint azriel-healthpoint commented May 27, 2025

Short version:

  1. This likely should've been done against the 8.0.x branch, but I began the branch off master, and I pulled as much time as I can to push it back upstream (sorry 🙇).
  2. This means if any changes need to be made, someone else has to pick it up from here -- I'm essentially leaving you with where I got to.
  3. I haven't actually tested this via generation -- just ported the code over after getting things to compile on a project.
  4. Biggest changes are hyper 0.14 to 1.6, and tokio 0.2 to 1.45.
  5. hyper's service_fn requires hyper::service::service::Service to return a Request<Incoming>. The previous version had a Service return another Service
  6. Swagger 7.0.0-rc1 is needed because that depends on hyper 1.x; Feature/174/implement clone for make allow all authenticator Metaswitch/swagger-rs#179 may be of interest.

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • Run the following to build the project and update samples:
    ./mvnw clean package || exit
    ./bin/generate-samples.sh ./bin/configs/*.yaml || exit
    ./bin/utils/export_docs_generators.sh || exit
    
    (For Windows users, please run the script in WSL)
    Commit all changed files.
    This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
    These must match the expectations made by your contribution.
    You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*.
    IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
  • File the PR against the correct branch: master (upcoming 7.x.0 minor release - breaking changes with fallbacks), 8.0.x (breaking changes without fallbacks)
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

cc: @frol @farcaller @richardwhiuk @paladinzh @jacob-pro

@azriel-healthpoint azriel-healthpoint force-pushed the feature/17876/update-rust-server-dependency-versions branch from d6aa351 to 5fcecae Compare May 27, 2025 20:00
@wing328
Copy link
Member

wing328 commented Jun 4, 2025

thanks for the PR

https://github.com/OpenAPITools/openapi-generator/actions/runs/15284539236/job/43442947536?pr=21332

please update the samples when you've time

@wing328
Copy link
Member

wing328 commented Jun 4, 2025

This likely should've been done against the 8.0.x branch, but I began the branch off master, and I pulled as much time as I can to push it back upstream (sorry 🙇).

agreed. another way is to merge this into master and provide rust-server-deprecated for fallback instead so that users can fallback to current setup if they want to

@wing328
Copy link
Member

wing328 commented Jun 4, 2025

I haven't actually tested this via generation -- just ported the code over after getting things to compile on a project.

would be nice if you can run some tests and ideally run it in production to ensure the output is ready for production

@azriel-healthpoint azriel-healthpoint force-pushed the feature/17876/update-rust-server-dependency-versions branch from b1e10c7 to 15a35da Compare June 11, 2025 20:45
@azriel-healthpoint
Copy link
Contributor Author

Heya, I regenerated samples, and discovered the templates aren't updated in use-cases that weren't in my project.

I've progressed it a little more, but the generated sample code doesn't compile yet.

Probably best if someone else picks up from here, my workflow is:

# in one terminal
./bin/generate-samples.sh ./bin/configs/rust-server-*.yaml || exit

# in another terminal
cd samples/server/petstore/rust-server/output/openapi-v3
cargo run --example server
# then use compile errors as hints where to change

@azriel-healthpoint azriel-healthpoint force-pushed the feature/17876/update-rust-server-dependency-versions branch from 15a35da to 9795e2c Compare June 11, 2025 20:55
@wing328
Copy link
Member

wing328 commented Jun 16, 2025

hyper 1.6, tokio 1.45

what about updating just one of the dependencies (either hyper or tokio) to make all the tests pass first in this PR to start with?

@dsteeley
Copy link
Contributor

dsteeley commented Jun 17, 2025

I've picked this up from where you got to @azriel-healthpoint and have done the following.

  • All rust-server samples compiling
  • Added a rust-server-deprecated as a fallback for hyper0.14 users
  • Additional testing in CI that the samples compile and pass checks
  • Re-add the typed headers auth changes added by @cvkem

I think it makes sense to move the changes to a new PR, #21422. @wing328 does that sound acceptable?

@wing328
Copy link
Member

wing328 commented Jul 2, 2025

@dsteeley
Copy link
Contributor

dsteeley commented Jul 2, 2025

https://github.com/OpenAPITools/openapi-generator/actions/runs/15595463910/job/44141290175?pr=21332

can you please review the build failure when you've time?

See #21422 which I've now fixed up and should supersede this PR.

Any objections to closing this one for clarity on where the changes are being made?

@wing328 wing328 closed this Jul 2, 2025
@wing328
Copy link
Member

wing328 commented Jul 2, 2025

agreed. just closed it

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants