Coder Social home page Coder Social logo

Comments (4)

mathieuales avatar mathieuales commented on June 17, 2024

Hi !

Thanks for using angular-swagger-ui.
It's a documentation issue :-( when using 0.1.6 you should use directive as described below to enable request transformation:

<div swagger-ui
     url="swaggerUrl"
     api-explorer="true"
     error-handler="myErrorHandler"
     api-explorer-transform="myTransform">
</div>

Then make sure your swagger API descriptor defines the Content-Type of your operation in its definition see consumes parameter

You can also take a look at the example in dist/index.html.

Hope this helps !

from angular-swagger-ui.

konczak avatar konczak commented on June 17, 2024

I think that integration of Angular-Swagger-Bootstrap is awesome idea - thank you for your work!

You are right that I should use api-explorer-transform in 0.1.6 so I change it but issue still remain the same.

I know that Content-Type served by server has to be in place and it is as you can see:

 "post":{
    "tags":[
       "place-api"
    ],
    "summary":"Add new Place [HR]",
    "description":"Returns created Place",
    "operationId":"addUsingPOST",
    "consumes":[
       "application/json"
    ],
    "produces":[
       "*/*"
    ],
    "parameters":[
       {
          "in":"body",
          "name":"placeNew",
          "description":"placeNew",
          "required":true,
          "schema":{
             "$ref":"#/definitions/PlaceNew"
          }
       }
    ],
    "responses":{
       "200":{
          "description":"Create new Place",
          "schema":{
             "$ref":"#/definitions/Place"
          }
       },
       "201":{
          "description":"Created"
       },
       "400":{
          "description":"Invalid input"
       },
       "401":{
          "description":"Unauthorized"
       },
       "403":{
          "description":"Forbidden"
       },
       "404":{
          "description":"Not Found"
       }
    }
 }

And you can see application/json content in the UI to choose and that body is specified as well:
zrzut ekranu 2015-07-14 12 37 27

from angular-swagger-ui.

mathieuales avatar mathieuales commented on June 17, 2024

I found the issue, it ill be fixed in next release ASAP.
Workaround: all parameters in body must be named "body" in your Swagger API descriptor.

from angular-swagger-ui.

mathieuales avatar mathieuales commented on June 17, 2024

should be fixed in 0.2
can you confirm ?

from angular-swagger-ui.

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.