swagger-api / swagger-core

Examples and server integrations for generating the Swagger API Specification, which enables easy access to your REST API
http://swagger.io
Apache License 2.0
7.38k stars 2.18k forks source link

Missing endpoints in generated OpenAPI spec #4552

Closed nntzuekai closed 9 months ago

nntzuekai commented 11 months ago

I am trying Swagger Core on this REST API: https://github.com/apilayer/restcountries/tree/master

In the generated spec (restcountries.json), I found these endpoints are missing: "POST /contribute", "POST /v1", "GET /v1", "POST /v2", and "GET /v2", which are defined in https://github.com/apilayer/restcountries/blob/master/src/main/java/eu/fayder/restcountries/v2/rest/StripeRest.java, https://github.com/apilayer/restcountries/blob/master/src/main/java/eu/fayder/restcountries/v1/rest/CountryRest.java, and https://github.com/apilayer/restcountries/blob/master/src/main/java/eu/fayder/restcountries/v2/rest/CountryRest.java.

I added to the pom:

       <dependency>
            <groupId>io.swagger.core.v3</groupId>
            <artifactId>swagger-jaxrs2</artifactId>
            <version>2.2.7</version>
        </dependency>
        <dependency>
            <groupId>io.swagger.core.v3</groupId>
            <artifactId>swagger-jaxrs2-servlet-initializer-v2</artifactId>
        <version>2.2.7</version>
        </dependency> 

Can you check if this is a bug or me missing some configurations? Thank you!

micryc commented 9 months ago

Hi @nntzuekai could you share with us some more details about your project (full project etc.) ? Unfortunately with resources you have already provided , it's hard to find out what went wrong.

micryc commented 9 months ago

It looks like swagger-core works properly in that case, after quick reproduction with https://github.com/apilayer/restcountries/tree/master it generates spec with "missing" endpoints openapi-restcountries.json