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-Axum] Fix uuid in header params causing compilation errors #18563

Merged
merged 5 commits into from
May 7, 2024

Commits on May 5, 2024

  1. fix: Fix uuid in header params causing errors

    Routes with header parameters with a `format` of `uuid` in the openAPI
    specification used to cause a compilation error in the resulting
    Rust Axum code.
    This commit fixes the issue by including the correct conversion trait
    implementation on the condition that at least one header parameter of
    `format` `uuid` is included in the specification.
    myz-dev authored and Mert Yildiz committed May 5, 2024
    Configuration menu
    Copy the full SHA
    c5963b6 View commit details
    Browse the repository at this point in the history
  2. refactor: Add final to boolean

    myz-dev authored and Mert Yildiz committed May 5, 2024
    Configuration menu
    Copy the full SHA
    7a83cbb View commit details
    Browse the repository at this point in the history
  3. fix: Bring str::FromStr optionally into scope

    The trait needs to be in scope for the TryFrom implementation:
    `TryFrom<HeaderValue> for IntoHeaderValue<uuid::Uuid> `
    It will only be brought into scope when the implementation is rendered.
    myz-dev authored and Mert Yildiz committed May 5, 2024
    Configuration menu
    Copy the full SHA
    6bee82e View commit details
    Browse the repository at this point in the history
  4. test: Add integration test and its specification

    This commit adds an integration test that tests the bug fix for OpenAPITools#18554.
    A header parameter of `format: uuid` is included in one route.
    This makes the example create a route handler that tries to extract a
    Rust `uuid::Uuid` type from the header. The integration test will check
    that the generated code compiles.
    myz-dev committed May 5, 2024
    Configuration menu
    Copy the full SHA
    97337f2 View commit details
    Browse the repository at this point in the history
  5. test: Update examples and run integration test

    The generated samples are updated with:
    `./bin/generate-samples.sh ./bin/configs/manual/*.yaml`
    Most example projects have their version numbers bumped. Some changes
    show, that there are some other unrelated changes to the files, which
    indicates that some prior commit did not update the samples accordingly.
    The relevant integration test
    `mvn integration-test -f samples/server/petstore/rust-axum/pom.xml`
    passes.
    myz-dev committed May 5, 2024
    Configuration menu
    Copy the full SHA
    a8e06cd View commit details
    Browse the repository at this point in the history