-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid examples
syntax in the filters
parameter
#140
Comments
That is valid YAML and preferable over mixing indented lists and bracket annotations (there is an argument to be made for added newlines for new levels but YMMV). +1 for reminding of the correct way to edit YAML then convert; but the conversion script - which also serves as a syntax test- is happy with the current style, too. Sent from my iPhoneOn 10 Jul 2024, at 21:28, Daniel Tsirulnikov ***@***.***> wrote:
The model endpoint files define the filters parameter with an examples such as:
Existing Syntax:
examples:
- - variantcaller:GATK4.0
or
examples:
- - NCIT:C3222
- - OBI:0100058
- NCIT:C4813
Here are all the locations this invalid syntax can be found:
https://github.com/search?q=repo%3Aga4gh-beacon%2Fbeacon-v2%20%22-%20%20%20-%22&type=code
Corrected Syntax:
The correct syntax for an array example should be:
example: [variantcaller:GATK4.0]
or
example: [NCIT:C3222, OBI:0100058, NCIT:C4813]
Reference:
OpenAPI Specification - Adding Examples
Note:
After fixing the .yaml files, the .json should be fixed as well by running the schema conversion script located in the bin folder.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Thank you @mbaudis. To better illustrate the issue: The current filters:
name: filters
in: query
schema:
type: array
items:
type: string
examples: # <-- Error: Property examples is not allowed. (yaml-schema: OpenAPI 3.0.X)
- - variantcaller:GATK4.0 As noted, the filters:
name: filters
in: query
schema:
type: array
items:
type: string
examples:
- - variantcaller:GATK4.0 # <-- Error: Incorrect type. Expected "object(OpenAPI 3.0.X)". (yaml-schema: OpenAPI 3.0.X) Because of the invalid syntax, this is a blocking issue for code generators like OpenAPI Generator which shows the following error and does not work:
For the filters:
name: filters
in: query
schema:
type: array
items:
type: string
examples:
example1:
value: [variantcaller:GATK4.0] Or change the |
The Json Schema spec. defines "examples" as an array of values. In this case it is an array of arrays. Json Schema: filters:
name: filters
in: query
schema:
type: array
items:
type: string
examples:
- - variantcaller:GATK4.0
- variantcaller:GATK3.7 or OpenAPI parameter: filters:
name: filters
in: query
schema:
type: array
items:
type: string
example:
- variantcaller:GATK4.0
- variantcaller:GATK3.7 IMO should be the OpenAPI, as I don't believe tools analyze the schema for examples. Correction: filters:
name: filters
in: query
schema:
type: array
items:
type: string
examples:
example1:
description: some example
value: [variantcaller:GATK4.0] |
The model endpoint files define the
filters
parameter with an examples such as:Existing Syntax:
or
Here are all the locations this invalid syntax can be found:
https://github.com/search?q=repo%3Aga4gh-beacon%2Fbeacon-v2%20%22-%20%20%20-%22&type=code
Corrected Syntax:
The correct syntax for an array example should be:
or
Reference:
OpenAPI Specification - Adding Examples
Note:
After fixing the
.yaml
files, the.json
should be fixed as well by running the schema conversion script located in the bin folder.The text was updated successfully, but these errors were encountered: