You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Adding the property "implementation" in Schema prints the whole object's structure instead of "$ref".
Example : @Schema(name = "paymentInformation", type = SchemaType.ARRAY, minItems = 1, maxItems = 1, implementation = PaymentInstruction.class) @NotNull @SiZe(min=1, max=1)
private @Valid List paymentInformation = new ArrayList();
Steps to Reproduce
Add property "implementation" to an ArrayList of user defined class. @Schema(name = "paymentInformation", type = SchemaType.ARRAY, minItems = 1, maxItems = 1, implementation = PaymentInstruction.class) @NotNull @SiZe(min=1, max=1)
private @Valid List paymentInformation = new ArrayList();
Expected behavior
Openapi should refer to the existing object using $ref instead of printing the whole object
This is the snippet without implementation class (using $ref) @Schema(name = "payment_information", type = SchemaType.ARRAY, minItems = 1, maxItems = 1)
private @Valid List paymentInformation = new ArrayList<>();
payment_information:
maxItems: 1
minItems: 1
type: array
description: payment info
items:
type: array
description: payment info
items: $ref: '#/components/schemas/PaymentInstruction'
This is post adding implementation class @Schema(name = "payment_information", type = SchemaType.ARRAY, minItems = 1, maxItems = 1, implementation = PaymentInstruction.class)
private @Valid List paymentInformation = new ArrayList<>();
payment_information:
maxItems: 1
minItems: 1
type: array
description: payment info
items:
maxItems: 1
required:
- credit_transfer_transaction_information
- debtor
- debtor_account
- payment_information_identification
type: object
properties:
payment_information_identification:
maxLength: 35
minLength: 1
type: string
description: Unique identification, as assigned by a sending party,
to unambiguously identify the payment information group within
the message
example: 1047658536..............
Diagnostic information:
OpenLiberty Version: 20.0.0.6
Java Version: java version "1.8.0"
Java(TM) SE Runtime Environment (build pwa6480sr2fp10ifix-20160223_01(SR2 FP10+IV81318+IV81645+IV81741+IV81716))
IBM J9 VM (build 2.8, JRE 1.8.0 Windows 10 amd64-64 Compressed References 20160210_289934 (JIT enabled, AOT enabled)
J9VM - R28_Java8_SR2_20160210_1617_B289934
JIT - tr.r14.java_20151209_107110.04
GC - R28_Java8_SR2_20160210_1617_B289934_CMPRSS
J9CL - 20160210_289934)
JCL - 20151231_01 based on Oracle jdk8u71-b15
server.xml configuration
jsp-2.3
microProfile-3.0
jaxb-2.2
<!-- To access this server from a remote client add a host attribute to the following element, e.g. host="*" -->
<httpEndpoint id="defaultHttpEndpoint"
httpPort="9080"
httpsPort="9443" />
<!-- Automatically expand WAR files and EAR files -->
<applicationManager autoExpand="true"/>
- If it would be useful, upload the messages.log file found in `$WLP_OUTPUT_DIR/messages.log`
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
@shankar6477 This issue is working as designed. The schema will always be inlined (rather than using $ref) because it is not a simple usage of the implementation attribute on the @Schema annotation, i.e., the inclusion of other attributes (minItems and maxItems in this case) effectively means that a new schema is being defined.
However, this issue can be avoided when using the mpOpenAPI-2.0 feature by not including the implementation attribute on the @Schema annotation.
mpOpenAPI-2.0 is included as beta in the upcoming OpenLiberty 20.0.0.11 release.
Describe the bug
Adding the property "implementation" in Schema prints the whole object's structure instead of "$ref".
Example :
@Schema(name = "paymentInformation", type = SchemaType.ARRAY, minItems = 1, maxItems = 1, implementation = PaymentInstruction.class)
@NotNull
@SiZe(min=1, max=1)
private @Valid List paymentInformation = new ArrayList();
Steps to Reproduce
Add property "implementation" to an ArrayList of user defined class.
@Schema(name = "paymentInformation", type = SchemaType.ARRAY, minItems = 1, maxItems = 1, implementation = PaymentInstruction.class)
@NotNull
@SiZe(min=1, max=1)
private @Valid List paymentInformation = new ArrayList();
Expected behavior
Openapi should refer to the existing object using $ref instead of printing the whole object
This is the snippet without implementation class (using $ref)
@Schema(name = "payment_information", type = SchemaType.ARRAY, minItems = 1, maxItems = 1)
private @Valid List paymentInformation = new ArrayList<>();
payment_information:
maxItems: 1
minItems: 1
type: array
description: payment info
items:
type: array
description: payment info
items:
$ref: '#/components/schemas/PaymentInstruction'
This is post adding implementation class
@Schema(name = "payment_information", type = SchemaType.ARRAY, minItems = 1, maxItems = 1, implementation = PaymentInstruction.class)
private @Valid List paymentInformation = new ArrayList<>();
payment_information:
maxItems: 1
minItems: 1
type: array
description: payment info
items:
maxItems: 1
required:
- credit_transfer_transaction_information
- debtor
- debtor_account
- payment_information_identification
type: object
properties:
payment_information_identification:
maxLength: 35
minLength: 1
type: string
description: Unique identification, as assigned by a sending party,
to unambiguously identify the payment information group within
the message
example: 1047658536..............
Diagnostic information:
Java(TM) SE Runtime Environment (build pwa6480sr2fp10ifix-20160223_01(SR2 FP10+IV81318+IV81645+IV81741+IV81716))
IBM J9 VM (build 2.8, JRE 1.8.0 Windows 10 amd64-64 Compressed References 20160210_289934 (JIT enabled, AOT enabled)
J9VM - R28_Java8_SR2_20160210_1617_B289934
JIT - tr.r14.java_20151209_107110.04
GC - R28_Java8_SR2_20160210_1617_B289934_CMPRSS
J9CL - 20160210_289934)
JCL - 20151231_01 based on Oracle jdk8u71-b15
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: