I'm using OpenAPIV3Parser to get openAPI specifications for the parser version 2.1.13. I am wondering if it is possible to validate the AllOf schema in a way that allows the same field to have different data types for each given object. Currently, the AllOf schema does not allow this, which can sometimes mislead the tooling supports we have implemented.
The schema we have provided has name property in the AdminUser schema is of type integer, while the name property in the User schema is of type string. This means that an AdminUser object cannot have both a string name and an integer name.
At the same time I would be grateful if you can provide some insight whether this schema is valid written one [2], because this AllOf schema contains links field with different Object schema type
example [2]
components:
schemas:
DetectedCatalogColumn:
allOf:
- $ref: '#/components/schemas/CatalogColumn'
- required:
- links
type: object
properties:
links:
$ref: '#/components/schemas/DetectedCatalogColumnLinks'
description: The catalog column detected during the first parsing step
CatalogColumn:
required:
- catalogColumnName
- configuration
- id
- links
- userColumName
type: object
properties:
ignored:
type: boolean
default: false
duplicateProductValueConfiguration:
type: string
id:
type: integer
links:
$ref: '#/components/schemas/CatalogColumnLinks'
description: The catalog column configuration
CatalogColumnLinks:
type: object
properties:
rename:
$ref: '#/components/schemas/Links.Catalog_ChangeCatalogColumnUserNameLink'
Links.Catalog_ChangeCatalogColumnUserNameLink:
allOf:
- $ref: '#/components/schemas/BeezUP_Common_Link3'
BeezUP_Common_Link3:
required:
- href
type: object
properties:
label:
type: string
description: >-
The label corresponding to the link. This label is automatically
translated based on the Accept-Language http header.
example: The translated label
docUrl:
type: string
description:
type: string
description: The description of the link
example: This is a description link
urlTemplated:
type: boolean
description: indicates whether the href is templated or not
allRequiredParamsProvided:
type: boolean
description: indicates whether all required params have been provided
allOptionalParamsProvided:
type: boolean
DetectedCatalogColumnLinks:
type: object
properties:
configure:
type: string
ignore:
type: integer
reattend:
type: boolean
Hi Team,
I'm using
OpenAPIV3Parser
to get openAPI specifications for the parser version 2.1.13. I am wondering if it is possible to validate the AllOf schema in a way that allows the same field to have different data types for each given object. Currently, the AllOf schema does not allow this, which can sometimes mislead the tooling supports we have implemented.Please find this sample YAML file for AllOf reference to the main issue
detectedCatalogColumn
schema https://gist.github.com/lnash94/13473a548f9306b88e1270a77b465abdexample code [1]:
The schema we have provided has
name
property in theAdminUser
schema is of typeinteger
, while thename
property in the User schema is of typestring
. This means that an AdminUser object cannot have both a string name and an integer name.At the same time I would be grateful if you can provide some insight whether this schema is valid written one [2], because this AllOf schema contains links field with different Object schema type
example [2]
Reference tool: https://github.com/ballerina-platform/openapi-tools https://ballerina.io/learn/openapi-tool/