Skip to content

Text plain type generated as json #264

@Lui92

Description

@Lui92

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions