Comments (9)
You can try reading my Swagger JSON here: http://qa.walletron.com/api/api-docs
Thanks and great project!
-Garrett
from swagger2markup.
Hello,
the exceptions is thrown in the official SwaggerParser. But why does the server return a 500 HTTP Code? This does not seem to be a problem of the Parser, but of the server code?
Kind regards,
Robert
from swagger2markup.
The server is expecting the encoded URL, in this case: http://localhost:8080/Walletron/api/api-docs/ver1/brands/%7Bbrand%7D/templates That works just fine and it appears browsers like Chrome and cUrl utilities like Postman do this automatically. I am able however to reproduce the error on a straight curl from the command line.
Is there a config setting I'm missing to get swagger to encode this? Sorry to waste your time. :(
from swagger2markup.
Could you please address this issue in https://github.com/swagger-api/swagger-parser
from swagger2markup.
In my demo it works with brackets. https://github.com/RobWin/spring-swagger2markup-demo
@RestController
@RequestMapping(value = "/quotas")
@Api(value = "Quotas API", description = "Quotas API allows bla bla bla bla.")
public class MailStorageQuotaController{
@ResponseStatus(HttpStatus.NO_CONTENT)
@RequestMapping(method = RequestMethod.PUT)
@ApiOperation(value = "Create a quota.", notes = "Create a quota allows bla bla bla bla")
public void createMailStorageQuota(@ApiParam(name = "MailStorageQuota", value = "MailStorageQuota", required = true) @RequestBody MailStorageQuota mailStorageQuota) {
}
@ResponseStatus(HttpStatus.NO_CONTENT)
@RequestMapping(value = "/{quotaId}", method = RequestMethod.POST)
@ApiOperation(value = "Update a quota.", notes = "Update a quota allows bla bla bla bla")
public void updateMailStorageQuota(@ApiParam(value = "quotaId", required = true)
@PathVariable("quotaId") String quotaId,
@ApiParam(name = "MailStorageQuota", value = "MailStorageQuota", required = true)
@RequestBody MailStorageQuota mailStorageQuota) {
}
@RequestMapping(value = "/{quotaId}", method = RequestMethod.GET)
@ApiOperation(value = "Get a quotas.", notes = "Get a quota allows bla bla bla bla")
public MailStorageQuotaResponse getMailStorageQuota(@PathVariable("quotaId") String quotaId) {
return new MailStorageQuotaResponse(new MailStorageQuota(MailStorageQuotaValue.NINETYDAYS, QuotaValueType.CUSTOM));
}
@ResponseStatus(HttpStatus.NO_CONTENT)
@RequestMapping(value = "/{quotaId}", method = RequestMethod.DELETE)
@ApiOperation(value = "Delete a quota.", notes = "Delete a quotas allows bla bla bla bla")
public void deleteMailStorageQuota(@PathVariable("quotaId") String quotaId) {
}
}
from swagger2markup.
Hmm, I'm using Jersey - here's an example:
There are the problematic curly braces in the middle of the Path...
@path("ver1/brands/{brand}/templates")
@Api(value = "ver1/brands/{brand}/templates", description = "Communication Template Management")
@RequestScoped
public class TemplateRestApi {
@GET
@ApiOperation(value = "List existing communication templates", response = Template.class, responseContainer = "List")
@ApiResponses(value = {
@ApiResponse(code = 500, message = "Exception"),
@ApiResponse(code = 404, message = "Not authorized")
})
@Produces(MediaType.APPLICATION_JSON)
public Response getTemplatesByBrand(
}
Looks like Swagger Parser MAY have addressed this in 1.0.1 but I'm not sure.
from swagger2markup.
Can't you change the Paths as follows:
@Path("ver1/brands/{brand}")
@Api(value = "ver1/brands/{brand}", description = "Communication Template Management")
@RequestScoped
public class TemplateRestApi {
@GET
@Path("/templates")
@ApiOperation(value = "List existing communication templates", response = Template.class, responseContainer = "List")
@ApiResponses(value = {
@ApiResponse(code = 500, message = "Exception"),
@ApiResponse(code = 404, message = "Not authorized")
})
@Produces(MediaType.APPLICATION_JSON)
public Response getTemplatesByBrand(
}
from swagger2markup.
Unfortunately, Jersey doesn't like the duplicates that creates. I have several classes based on this "brand" entity. Here's an update over on the parser project that I believe will solve this problem: swagger-api/swagger-parser#32
Thanks for your attention on this!
from swagger2markup.
You are welcome.
Feel free to give me your star ;-)
from swagger2markup.
Related Issues (20)
- OpenApi 3.0 to Markdown output
- OpenApi 3.0 descriptions to be converted valid asciidoc
- I hope converting to .doc HOT 2
- Paths Index HOT 8
- Wrong JSON for response example
- No new release since April 2018 ... is the project abandoned? HOT 10
- 能否折叠表格? HOT 1
- StackOverflow when examples have cyclic references #173
- swagger2markup.extensions.dynamicDefinitions.contentPath not working in swagger2markup 2.0.0 snapshot
- null values are cleaned out in adoc
- JCenter is Gone
- Swagger v3 cannot use swagger2markup(1.3.3) HOT 1
- About @Tags HOT 1
- Can we implement this swagger2markup with swagger 3 ?
- Remove dependency on pegdown HOT 4
- swagger2markup-cli 1.3.4 jar is missing in maven central HOT 8
- Latest JAR library on https://mvnrepository.com/ doesn't include OpenAPI classes HOT 4
- Grouping by TAG for OpenAPI v3.0 is ignored
- QA: does support springdoc-openapi-ui ?
- END Header Not Found on internal dependencies paleo-core and asciidoc
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 swagger2markup.