Consider below YAML model definition of an entity “Disk” in swagger 3.0
If consists of one property “diskName”. I want to alias that property with “deviceName”, so that I don’t have to add another property definition for “deviceName”.
components:
schemas:
Disk:
allOf:
- type: "object"
properties:
diskName:
type: "string"
x-constraints:
maxLength: "ConstantRef(maxNameLength)"
# Alias diskName to deviceName as well
How can I alias the diskName to deviceName so that I can use the term interchangeably?
I appreciate any help you can provide.
I tried the following ways to achieve the result, but was unable to succeed.
diskName:
type: "string"
x-constraints:
maxLength: "ConstantRef(maxNameLength)"
# alias: "{{ deviceName }}"
# alias:
# - deviceName
# x-alias: deviceName