Giter Site home page Giter Site logo

Comments (4)

commonsensesoftware avatar commonsensesoftware commented on June 11, 2024

On the line:

https://github.com/GProGamer/HotelListing/blob/master/HotelListing.API/Program.cs#L52

you need to add .AddMvc(). Starting in API Versioning 6.0, this call is now required to bring in MVC Core. Without this call, only Minimal APIs are considered. The fact that anything works at all is a coincidence. I suspect after you add that, things will work as expected.

Note: this calls IApiVersioningBuilder.AddMvc and not IServiceCollectionBuilder.AddMvc, which does something different

from aspnet-api-versioning.

GProGamer avatar GProGamer commented on June 11, 2024

I've forgot to say that I've already try to add .AddMvc(). I've tried again but I'm still getting the same weird behaviour:
it just shows version 1
image
image
image

but not version 2:

image

Help me please

from aspnet-api-versioning.

commonsensesoftware avatar commonsensesoftware commented on June 11, 2024

I browsed over the repro a little too fast. There's actually a number of things missing from your configuration that should be there. This information is provided in the wiki and example projects with OpenAPI and Swashbuckle. Ultimately, you need to use the API Explorer extensions provided by API Versioning to drive the generation of OpenAPI documents with Swashbuckle. There is no formal concept of versioning in the API Explorer, so Swashbuckle does not know how to use the information without a little help.

Since you provided a repro, you can apply the following Git patch and you should be only your way.

fix-config.patch

from aspnet-api-versioning.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.