-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Milestone
Description
Description
Swagger-codegen does not generate the @NotNull annotation for the required property password of model UserRegister. The email property declared in model User is handled correctly, I can see the @NotNull annotation if front the corresponding method.
This has something to do with inheritance. The required field in the inheriting model (in this case - UserRegister) is ignored for both inherited (email) and new (password) properties.
Swagger-codegen version
2.2.3
Swagger declaration file content or url
definitions:
User:
type: object
required:
- email
properties:
email:
type: string
UserRegister:
allOf:
- $ref: '#/definitions/User'
type: object
required:
- password
properties:
password:
type: stringMaven configuration
<plugin>
<groupId>io.swagger</groupId>
<artifactId>swagger-codegen-maven-plugin</artifactId>
<version>2.2.3</version>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
<id>willbot</id>
<configuration>
<inputSpec>demo.yaml</inputSpec>
<language>spring</language>
<configOptions>
<sourceFolder>src/gen/main/java</sourceFolder>
<useBeanValidation>true</useBeanValidation>
<enable303>true</enable303>
</configOptions>
<apiPackage>server</apiPackage>
<modelNameSuffix>Dto</modelNameSuffix>
</configuration>
</execution>
</executions>
</plugin>
Reactions are currently unavailable