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

Make layout configurable between Standalone and Base #233

Merged
merged 5 commits into from
Jul 26, 2022
Merged

Make layout configurable between Standalone and Base #233

merged 5 commits into from
Jul 26, 2022

Conversation

ju6ge
Copy link
Contributor

@ju6ge ju6ge commented Jul 25, 2022

Hey,

I added an option to the Config in Swagger to enable toggling between Standalone and Base Layout.

Kind regards,
ju6ge

Copy link
Owner

@juhaku juhaku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice addition 👍 I would add this new function to the test with name format_swagger_config_with_multiple_fields and update the test to cover this use_base_layout() case as well :)

@ju6ge
Copy link
Contributor Author

ju6ge commented Jul 26, 2022

I also updated the tests now, but I somehow cannot run the test suit because the build of utoipa-gen fails:

error[E0369]: binary operation `==` cannot be applied to type `Option<Cow<'_, TypePath>>`
  --> utoipa-gen/src/schema.rs:30:5
   |
27 | #[derive(PartialEq)]
   |          --------- in this derive macro expansion
...
30 |     pub path: Option<Cow<'t, TypePath>>,
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info)

Which is weird because it works when I compile when importing the code from another project 🤨

Copy link
Owner

@juhaku juhaku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code does look fine 🥇 :)

@juhaku
Copy link
Owner

juhaku commented Jul 26, 2022

That's really weird. It should compile though. If you run the cargo test -p utoipa-swagger-ui --features actix-web,axum,rocket -- --show-output command it ends up in following error?

I ran the command above and even with nightly cargo +nighly test ... and it passes. Just updated nightly to latest. It should work anything above the 1.60. though 😮

@ju6ge
Copy link
Contributor Author

ju6ge commented Jul 26, 2022

I am on cargo 1.64.0-nightly

Actually it works when I run the test suite with the command you provide, though some tests are failing because of the ordering of the arguments 🙄.

But just using cargo test fails …

@ju6ge
Copy link
Contributor Author

ju6ge commented Jul 26, 2022

Anyway tests are fixed now, that I could actually run them :D …

@juhaku
Copy link
Owner

juhaku commented Jul 26, 2022

But just using cargo test fails …

Right. Most of the tests needs some flags in order to work. And cannot use --all-features because then there are clashing implemenetations for different frameworks.

Anyway tests are fixed now, that I could actually run them :D …

Awesome.. 🏆

@juhaku juhaku merged commit 819a888 into juhaku:master Jul 26, 2022
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

Successfully merging this pull request may close these issues.

2 participants