Questions tagged [swagger-codegen-maven-plugin]

55 questions
7
votes
1 answer

How to inject custom spring validation inside swagger codegen?

We are able to use openApi documentation and generate our Java Input classes using the spring swagger-codegen. Also, we can inject the javax.validation annotations when input is generated for common constraints like length, mandatory etc. I would…
7
votes
1 answer

Make swagger codegen maven plugin access yaml files from another maven dependency

I have an API written in Swagger for which I want to generate both the Service implementation and also the client, and they have to be in separate maven modules. I was thinking of separating them into 3 separate Maven modules (or submodules of the…
jbx
  • 21,365
  • 18
  • 90
  • 144
6
votes
1 answer

How to merge multiple OpenAPI 3.0 specification files into one in Maven?

In a Maven project with Spring Boot, there are several OpenAPI 3.0 specification files. One spec defines all HTTP errors (errors.yml), and the components of errors.yml are referenced in other spec. I want to generate an output spec with all…
5
votes
0 answers

Swagger-Codegen plugin does not generate @Deprecated annotation

I would like to set an annotation @deprecated on the endpoint which is generated by swagger-codegen plugin from a yaml file like: paths: '/debug-endpoint/v1/person/{id}': get: deprecated: true summary: get person info …
Capfish
  • 51
  • 2
4
votes
1 answer

How do I configure swagger codegen (maven plugin) to return a bad request if one of my enum fields doesn't match?

I'm using the swagger-codegen-maven-plugin 3.0.20 with Java 10. I have these config options true false
Dave
  • 15,639
  • 133
  • 442
  • 830
4
votes
1 answer

swagger-codegen-maven-plugin ignores the importmapping i have set for ZonedDateTime when generating an API class

I am trying to generate an API class from a yaml file using ZonedDateTime as the class for a date. When i do this i can successfully change the generated class OffsetDateTime to ZonedDateTime in the configuration, but the correct import statement is…
4
votes
0 answers

Is there any way to override the getter value in swagger codegen?

I have my .yaml file as follows: (Just a partial definition) schemas: BaseResponse: type: object required: - success properties: success: type: boolean default: "false" When I run java…
4
votes
0 answers

enunciate Enum with custom value or property

I am now encountering the problem when generating Enum with custom properties. In Project A, i build a API-webservice. I use enunciate-maven-plugin (version 2.12.1) to generate swagger documentation from Java code. When enunciate-maven-plugin runs,…
anhquan
  • 1,338
  • 14
  • 21
3
votes
1 answer

Remove ResponseEntity in swagger-codegen-maven-plugin api class

I generated api classes with swagger-codegen-maven-plugin, and methods return ResponseEntity @ApiOperation(value = "", nickname = "getBlockingByMdmdId", notes = "", response = BlockingDto.class, tags={ "blocklist", }) @ApiResponses(value = { …
3
votes
1 answer

Swagger codegen - api and model

So this is codegen101 for me and I have been trying to use swagger plugin and keep getting error. Is it a known issue, I have tried serval versions for the plugin thinking it might be a known issue in one of them but no success at all.It should be…
3
votes
0 answers

swagger-codegen-maven-plugin generate interface implementation even if option interfaceOnly = true is used

I want to generate JAX-RS server stubs for my API using the swagger-codegen-maven plugin 3.0.16 , but I want to use my own service implementation class, instead of the one generated. In my config , I have specify config option interfaceOnly = true…
Florence
  • 1,641
  • 3
  • 13
  • 23
3
votes
0 answers

How to make enum field optional in Swagger Codegen Maven plugin?

TLDR: The problem seems to be that in swagger field should be mandatory when it is enum (Unlike java enum fields). I'm wondering if there is a way to make it optional I'm using swagger to generate some integration api from yaml…
WeGa
  • 801
  • 4
  • 10
  • 24
3
votes
1 answer

How to generate OAS yaml file from sources annotations using swagger 3.x?

I've spend hours on searching how to generate the OAS spec yaml file using swagger codegen in Java and I give up. I'd like to provide all API spec data within the Java source as a code annotations. It would be great to expose it via maven. AFAIK I…
3
votes
0 answers

Can I let swagger-codegen ignore some method parameters

I use swagger-codegen in my maven build to generate the Java interfaces for my REST layer. This works very well. However, there are a couple of parameters that I would like to exclude from the generated method's argument list. Question Is it…
neXus
  • 2,005
  • 3
  • 29
  • 53
3
votes
1 answer

How do I update RestTemplate to correctly map Java Dates?

I have an issue where my RestTemplate.postForEntity(url, restRequest, RepoResponse.class) call is failing because it can't deserialise dates of the form: 2019-02-01T12:00:00.000-0500 because of the missing colon in the timezone. Based on this…
deworde
  • 2,679
  • 5
  • 32
  • 60
1
2 3 4