-
Hi cue team, I have an issue with the openapi format generated by
The output is : openapi: 3.0.0
info:
title: Generated by cue.
version: no version
paths: {}
components:
schemas:
Response:
type: object
required:
- id
- result
properties:
id:
type: integer
minimum: 0
result:
type: object
VersionResponse:
type: object
properties:
result:
type: object
required:
- version
properties:
version:
type: string
allOf:
- $ref: '#/components/schemas/Response'
- required:
- result The problem comes from the Instead of VersionResponse:
type: object
properties:
result:
type: object
required:
- version
properties:
version:
type: string
allOf:
- $ref: '#/components/schemas/Response'
- required:
- result I think it should look like that with everything in the VersionResponse:
allOf:
- $ref: '#/components/schemas/Response'
- type: object
required:
- result
properties:
result:
type: object
required:
- version
properties:
version:
type: string WDYT? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
I noticed today that changing the conjunction to a disjunction, the resulting #Response: {
id: uint
result: {...}
}
#VersionResponse: #Response | {
result: version: string
} VersionResponse:
oneOf:
- $ref: '#/components/schemas/Response'
- properties:
result:
properties:
version:
type: string
required:
- version
type: object
required:
- result
type: object |
Beta Was this translation helpful? Give feedback.
-
@tbruyelle (apologies for the delay in replying) - is there a difference in semantics? Or is this purely an aesthetic point aimed at improving readability (which would potentially be worthy in its own right)? |
Beta Was this translation helpful? Give feedback.
-
This discussion has been migrated to cue-lang/cue#940. For more details about CUE's migration to a new home, please see cue-lang/cue#1078. |
Beta Was this translation helpful? Give feedback.
@tbruyelle (apologies for the delay in replying) - is there a difference in semantics? Or is this purely an aesthetic point aimed at improving readability (which would potentially be worthy in its own right)?