Skip to content
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

link from data types to vocabularies #46

Open
pvdbosch opened this issue Jan 6, 2020 · 1 comment
Open

link from data types to vocabularies #46

pvdbosch opened this issue Jan 6, 2020 · 1 comment
Milestone

Comments

@pvdbosch
Copy link
Contributor

pvdbosch commented Jan 6, 2020

In GitLab by @pvdbosch on Dec 11, 2019, 21:01

Most gCloud business data types in Swagger/OpenAPI are related to concepts defined in functional work group, (international) standards or, in the future, ICEG work groups.
The functional work group provides artifacts with more information about the concept.
It would be useful to add links to these definitions.

First discuss how to these links would look like, in a manner that they are clear and easy to keep updated.

@pvdbosch
Copy link
Contributor Author

pvdbosch commented Jan 7, 2020

Some ideas:

  • use a custom extension property (Swagger allows custom properties starting with 'x-'), for instance x-vocab-uri
    • this would allow some automatic processing by tooling
    • is the URI always dereferencable? Is it where the location where the best documentation is provided?
    • would it be applied at every level of a data type? (Schema Objects and properties)
  • add link in externalDocs
    • only a single external link is permitted, both in OpenAPI 2.0 and 3.0
    • add link in description field (which can be MarkDown format)
    • only applicable on HTTP body in OpenAPI 2.0 (i.e. not on query/path params)
    • not properly displayed by SwaggerUI

Example:

  Gender:
    description: "Gender of a person, following the ISO 5218 standard: 0 = Unknown, 1 = male, 2 = female. More info in [Belgif vocabularies](https://github.com/belgif/fedvoc/blob/master/FederalServicePlatform-Vocabularies.xlsx)"
    type: integer
    enum:
    - 0
    - 1
    - 2
    # code 9 in ISO 5218 signifies "not applicable" (e.g. when the gender property is applied to a genderless object) but is omitted here as it is not expected to be used in most use cases
    x-vocab-uri: http://vocab.belgif.be/auth/gender#id
    externalDocs:
      description: Belgif Federal Vocabularies 
      url: https://github.com/belgif/fedvoc/blob/master/FederalServicePlatform-Vocabularies.xlsx

2020-01-07_17h20_24

@pvdbosch pvdbosch added this to the backlog milestone Jan 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant