Comments (4)
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.
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:
from angular-swagger-ui.
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.
should be fixed in 0.2
can you confirm ?
from angular-swagger-ui.
Related Issues (20)
- render curl
- Html5 UI-router compatibiltiy HOT 1
- URL Parse Error when adding swagger-ui div HOT 2
- Publish older version on npm HOT 2
- Unable to npm install [email protected] HOT 3
- Node 8 support HOT 2
- Issue with rendering multiple api key in angular-swagger-ui HOT 3
- how to validate yaml by schema? HOT 1
- Syntax Error cant show petstore example HOT 8
- Question: Benefits & Comparisons HOT 2
- doesn't it support external references? HOT 4
- Works with any version lower than 0.5.0, but stops working from 0.5.0 HOT 5
- always the same model and sample when operationId is not specified HOT 3
- api key authorization configuration thru swaggerUiAuthProvider.credentials not working HOT 5
- Swagger UI page unresponsive for large swagger json HOT 6
- have a config to expand/list operations on load HOT 1
- Unknown provider: $swaggerTranslatorProvider HOT 1
- swagger ui fails to show sample response with items in response HOT 1
- Angular 7 support? HOT 2
- how to avoid sanitize? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular-swagger-ui.