-
Notifications
You must be signed in to change notification settings - Fork 25
Discrepancies between descriptions and type definitions #252
Comments
Regarding the examples (comment in #254), you mean that to be compliant with the spec they can't be null, is this correct? What would be the correct syntax to specify they can be omitted (not mandatory) or null (present but empty)? Would add
Does this mean that |
From my point of view Now from an implementation standpoint I would assume that most consumers of the API would make use of Another issue to address is: https://github.com/ga4gh-beacon/specification/blob/master/beacon.yaml#L119 usage or |
@blankdots Maybe open an issue about this, in general?
There is also the related problem of the different "start" attributes, which in principle could be solved through having We actually dump all values for the start and end attributes into 2 sorted arrays, and then
... etc. |
Short version:
More of a request rather than an issue, and maybe there is some CA4GH convention (and I could not find anything about it), but there seems to be some discrepancies between field descriptions and type definitions in the OpenAPI specification, can these be addressed ?
Despite the long version the points below are not so daunting or urgent, but improving them would definitely make the specification easier to follow and implement.
Long Version:
is of
type: array
but in the description it says it can also takenull
, but that is not a valid value fortype:array
, at best in JavaScriptnull
istype:object
null
but it has a required keyerrorCode
... well anull
value cannot have a required keynull
iferror
key is non-null,but here is the thing the
type: boolean
can never benull
, there can be a use case where theassemblyId
is not supported and theexists
can be null, and I assume it is the general rule when something is not supported to benull
.Assuming one make use of a JSON Schema, (maybe a bias here as it is a way I would implement it for this specification) to validate + test that something adheres to a specification for either a request or response, then:
When moving from
0.3
Avro to0.4
OpenAPI it was initially with both types defined (null
and some other type), and I think0.4
kinda broke backwards compatibility to0.3
.There are many examples in the
0.3
version, e.g.:https://github.com/ga4gh-beacon/specification/blob/v0.3.0/src/main/resources/avro/beacon.avdl#L62
remove
null
from descriptions for fields that are not required (in the implementation one would just have to check if the key exists), or if there is a an actual use case for thenull
(and I am aware of the point ofnull
meaning there is no data) values make it specific and apply Fix option 2.Make use of
nullable: true
https://swagger.io/docs/specification/data-models/data-types/In JSON Schema it would be
"type": ["number", "null"]
or make use ofanyOf
/oneOf
nullable
is not set.null
, because these are not 100% clear also e.g.datasetAlleleResponses
is not required why even addnull
?The text was updated successfully, but these errors were encountered: