Code Monkey home page Code Monkey logo

swagger4j's People

Contributors

awallgren avatar le-yams avatar olensmar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

swagger4j's Issues

Support for Swagger v2.0 spec?

Hi Ole,

kudos for the great library! Are you planning to support v2.0 swagger spec parsing in the near future?

Cheers,
Chris

At operation level there is no authorization...

I am trying to create swagger doc using swagger4j.A resource level I am able to add Authorization block but at Operation level this logic of adding Authorization is missing....Please help me resolving this issue..

Error in parsing dweet.io swagger description

Hi,
I tried to parse the following Swagger description: https://dweet.io/play/definition/

Unfortunately, Swagger4J returns this exception:
java.lang.AssertionError: Can not add API to Resource Listing; path already exists at com.smartbear.swagger4j.impl.ResourceListingImpl.addApi(ResourceListingImpl.java:85) at com.smartbear.swagger4j.impl.SwaggerReaderImpl.readResourceListing(SwaggerReaderImpl.java:68) at com.smartbear.swagger4j.impl.SwaggerReaderImpl.readResourceListing(SwaggerReaderImpl.java:43) at com.smartbear.swagger4j.Swagger.readSwagger(Swagger.java:81)

This is the source code:
ResourceListing resourceListing = Swagger.readSwagger("https://dweet.io/play/definition/");

Am I doing something wrong?

Thank you.

Wrong content negotiation when Swagge4J fetches swagger descriptions

Hello,
I am using Swagger4J to parse Swagger descriptions available on the iServe website (e.g., http://iserve.kmi.open.ac.uk/iserve/id/documents/18ee0842-f492-4f43-9073-ade556155526).
The website returns the swagger UI when "Accept: text/html" appears in the HTTP request header. Otherwise, it will return the JSON-based Swagger document when the header contains "Accept: application/json".
It looks like that Swagger4J is not able to fetch such JSON documents because in the HTTP request header contains "Accept: text/html, image/gif, image/jpeg, *; q=.2, /; q=.2".

I suppose that the header should contain "application/json" instead of "text/html". Isn't it?

Thank you very much for your help.
Cheers,

Luca

using Swagger.writeSwagger

Hi
I am using the following code in order to add api declaration without using annotations:
ResourceListing resourceListing = null;

        resourceListing = Swagger.createResourceListing(SwaggerVersion.DEFAULT_VERSION);

        resourceListing.setBasePath("http://localhost:8080/Spring/rest");
        SwaggerFactory factory = Swagger.createSwaggerFactory();

        ApiDeclaration apiDeclaration = factory.createApiDeclaration("http://localhost:8080/Spring/rest", "/bookmarks");
        Api api = apiDeclaration.addApi("/bookmarks");//the request url that is being called
        Operation operation = api.addOperation("getBookmarks",Operation.Method.GET);
        operation.setSummary("bookmarks list");
        operation.addProduces("application/atom+xml");


        resourceListing.addApi( apiDeclaration, "/bookmarks" );
        Swagger.writeSwagger(resourceListing, "src/main/webapp");

now, after performing Swagger.writeSwagger I do get api-docs.json and bookmarks.json files under "src/main/webapp" as, But- when I access in the Swagger-ui to the resource "http://localhost:8080/Spring/rest/api-docs" I can't get the bookmarks resource. so my question is how to integrate the jsons file I got from swaggerWriter into the api-docs resource that is generated by the swagger-core.

I will really appreciate your help here!!!

ClassCast Exception for the Authorization Attribute

When a swagger json file has an empty set for Authorization the cod is throwing an ClassCastException
org.glassfish.json.JsonArrayBuilderImpl$JsonArrayImpl cannot be cast to javax.json.JsonObject

This is within SwaggerReaderImpl.
child1 = parser.getChild("authorizations");
if(child1 != null) {
this.readAuthorizations(resourceListing, child1);
}

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.