GithubHelp home page GithubHelp logo

Comments (8)

kongchen avatar kongchen commented on May 17, 2024

Hi, I don't know why the latest swagger-ui use basePath in service.json, I read from swagger-core's wiki: https://github.com/wordnik/swagger-core/wiki/1.2-transition#wiki-10--resource-listing:

The resource listing no longer requires a basePath.

Also, as I test, the latest swagger ui's response is:

{
   "apiVersion":"1.0.0",
   "swaggerVersion":"1.2",
   "apis":[
      {
         "path":"/pet",
         "description":"Operations about pets"
      },
      {
         "path":"/user",
         "description":"Operations about user"
      },
      {
         "path":"/store",
         "description":"Operations about store"
      }
   ],
   "authorizations":{
      "oauth2":{
         "type":"oauth2",
         "scopes":[
            {
               "scope":"write:pets",
               "description":"Modify pets in your account"
            },
            {
               "scope":"read:pets",
               "description":"Read your pets"
            }
         ],
         "grantTypes":{
            "implicit":{
               "loginEndpoint":{
                  "url":"http://petstore.swagger.wordnik.com/oauth/dialog"
               },
               "tokenName":"access_token"
            },
            "authorization_code":{
               "tokenRequestEndpoint":{
                  "url":"http://petstore.swagger.wordnik.com/oauth/requestToken",
                  "clientIdName":"client_id",
                  "clientSecretName":"client_secret"
               },
               "tokenEndpoint":{
                  "url":"http://petstore.swagger.wordnik.com/oauth/token",
                  "tokenName":"auth_code"
               }
            }
         }
      }
   },
   "info":{
      "title":"Swagger Sample App",
      "description":"This is a sample server Petstore server.  You can find out more about Swagger \n    at <a href=\"http://swagger.wordnik.com\">http://swagger.wordnik.com</a> or on irc.freenode.net, #swagger.  For this sample,\n    you can use the api key \"special-key\" to test the authorization filters",
      "termsOfServiceUrl":"http://helloreverb.com/terms/",
      "contact":"[email protected]",
      "license":"Apache 2.0",
      "licenseUrl":"http://www.apache.org/licenses/LICENSE-2.0.html"
   }
}

There's no basePath either.

from swagger-maven-plugin.

Isnogud77 avatar Isnogud77 commented on May 17, 2024

Hi,

I was confused myself but then I found this:
https://github.com/wordnik/swagger-core/wiki/API-Declaration

There, the listing makes use of a basePath. After I've read this the phrase "does no longer requires" suddenly had a different meaning. It is not unsupported but rather optional in the 1.2 spec.

from swagger-maven-plugin.

kongchen avatar kongchen commented on May 17, 2024

Hi, I just add the support for basePath in service.json.
Please check if it can work using the 2.1-SNAPSHOT version.

from swagger-maven-plugin.

Isnogud77 avatar Isnogud77 commented on May 17, 2024

Works, thanks a lot!

from swagger-maven-plugin.

Isnogud77 avatar Isnogud77 commented on May 17, 2024

Hi,
We just noticed that this issue shows up again with the the plugin version 2.2 and 2.3-SNAPSHOT.

from swagger-maven-plugin.

kongchen avatar kongchen commented on May 17, 2024

Hi, do you mean it works on version 2.1 but not work on 2.2+?

from swagger-maven-plugin.

Isnogud77 avatar Isnogud77 commented on May 17, 2024

Exactly.

from swagger-maven-plugin.

kongchen avatar kongchen commented on May 17, 2024

Thank you for the finding, please try 2.3-SNAPSHOT

from swagger-maven-plugin.

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.