forked from loafle/openapi-generator-original
Fix extensions handling for allOf with single schema (#15632)
This commit is contained in:
parent
2b9677a29e
commit
765628fb77
@ -3993,6 +3993,9 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
if (p.getWriteOnly() != null) {
|
||||
property.isWriteOnly = p.getWriteOnly();
|
||||
}
|
||||
if (original.getExtensions() != null) {
|
||||
property.getVendorExtensions().putAll(original.getExtensions());
|
||||
}
|
||||
}
|
||||
|
||||
// set the default value
|
||||
|
@ -347,6 +347,11 @@ public class TestUtils {
|
||||
.containsWithName("javax.persistence.Transient")
|
||||
.toProperty()
|
||||
.toType();
|
||||
|
||||
JavaFileAssert.assertThat(java.nio.file.Paths.get(baseOutputPath + "/CompanyDto.java"))
|
||||
.hasProperty("priceCategory")
|
||||
.assertPropertyAnnotations()
|
||||
.containsWithNameAndAttributes("IgnoreForRoles", ImmutableMap.of("value", "\"MEDIA_ADMIN\""));
|
||||
}
|
||||
|
||||
public static ModelsMap createCodegenModelWrapper(CodegenModel cm) {
|
||||
|
@ -65,6 +65,8 @@ paths:
|
||||
description: A list resource collection of Employees.
|
||||
operationId: getEmployees
|
||||
summary: List all employees.
|
||||
/company:
|
||||
summary: Represents a Company
|
||||
components:
|
||||
schemas:
|
||||
EmployeeEntity:
|
||||
@ -277,3 +279,20 @@ components:
|
||||
description: Role that the employee is billed for on the project..
|
||||
type: string
|
||||
example: Consultant
|
||||
CompanyDto:
|
||||
type: object
|
||||
properties:
|
||||
priceCategory:
|
||||
description: The price category
|
||||
nullable: true
|
||||
x-field-extra-annotation: '@IgnoreForRoles("MEDIA_ADMIN")'
|
||||
allOf:
|
||||
- $ref: '#/components/schemas/SamplingPriceCategoryEnum'
|
||||
|
||||
SamplingPriceCategoryEnum:
|
||||
description: The price category of a sampling action
|
||||
type: string
|
||||
enum:
|
||||
- FREE
|
||||
- PRICE_TIER_1
|
||||
- PRICE_TIER_2
|
Loading…
x
Reference in New Issue
Block a user