We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi,
I would like to ask why text plain media type is generated as a json? Or maybe there is something wrong with it. I have this class:
@Path("/translations") @Api(value = "/translations", produces = MediaType.TEXT_PLAIN) public interface TranslationRestService { @GET @Path("/") @Produces(MediaType.TEXT_PLAIN) @ApiOperation(produces = MediaType.TEXT_PLAIN, value = "Get translations by language", code = 200) Response getTranslations(@QueryParam("lang") String lang); }
And when running ng-swagger-gen it generates like that:
// rest of generated service { headers: __headers, params: __params, responseType: 'json' });
In swagger it's normally available as text/plain. I'm using the newest version.
text/plain
The text was updated successfully, but these errors were encountered:
It depends on your source swagger definition. Posting it can help...
Sorry, something went wrong.
@luisfpg Sorry for the delay... I've totally forgot about it...
{ "swagger" : "2.0", "info" : { "description" : "This document contains the Rest service definition\n\t\t\t\t\t\t\t\t\tfor XXX application", "version" : "1.0.0", "title" : "XXX RESTful Service", "license" : { "name" : "XXX" } }, "basePath" : "/XXX/zzz/", "tags" : [ { "name" : "translations" } ], "schemes" : [ "http", "https" ], "paths" : { "/translations" : { "get" : { "tags" : [ "translations" ], "summary" : "Get translations by language", "description" : "", "operationId" : "getTranslations", "produces" : [ "text/plain" ], "parameters" : [ { "name" : "lang", "in" : "query", "required" : false, "type" : "string" } ], "responses" : { "default" : { "description" : "successful operation" } } } }, }, }
No branches or pull requests
Hi,
I would like to ask why text plain media type is generated as a json? Or maybe there is something wrong with it.
I have this class:
And when running ng-swagger-gen it generates like that:
In swagger it's normally available as
text/plain
. I'm using the newest version.The text was updated successfully, but these errors were encountered: