Skip to content

Docs/align tea api version grammar - #281

Open
Mehrn0ush wants to merge 3 commits into
CycloneDX:mainfrom
Mehrn0ush:docs/align-tea-api-version-grammar
Open

Mehrn0ush wants to merge 3 commits into
CycloneDX:mainfrom
Mehrn0ush:docs/align-tea-api-version-grammar

Conversation

@Mehrn0ush

Copy link
Copy Markdown
Contributor

Summary

  • Require full SemVer MAJOR.MINOR.PATCH for advertised API versions in the well-known schema and OpenAPI
  • Switch version examples to 1.0.0 (including /v1.0.0 construction)
  • Keep URL rule: highest mutual version, then append /v + that exact string

Closes #280.

Thanks @taleodor

Use one MAJOR.MINOR.PATCH (+ optional prerelease) pattern in the
well-known schema and OpenAPI, fix examples, and require appending
/v plus the exact advertised version. Closes CycloneDX#280.

Signed-off-by: Mehrn0ush <mehrnoush.vaseghi@gmail.com>
Require MAJOR.MINOR.PATCH only and switch advertised-version
examples to 1.0.0, per review on CycloneDX#280.

Signed-off-by: Mehrn0ush <mehrnoush.vaseghi@gmail.com>
Comment thread discovery/readme.md Outdated
Clients must pick any one of the endpoints listed in the `.well-known/tea` json
response. The client MUST pick an endpoint with the at least one version that is
supported by the client is using. The client MUST prioritize endpoints with the
response. The client MUST pick an endpoint with at least one version that is

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MUST -> SHALL

Comment thread discovery/readme.md Outdated
response. The client MUST pick an endpoint with the at least one version that is
supported by the client is using. The client MUST prioritize endpoints with the
response. The client MUST pick an endpoint with at least one version that is
supported by the client. The client MUST prioritize endpoints with the

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same, MUST -> SHALL

Comment thread discovery/readme.md Outdated
endpoints like these and if the priority field is present, the client SHOULD pick
the endpoint with the highest priority value (a float between 0 and 1).

The client MUST then construct the full URL to the API by selecting that highest

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same.

Comment thread discovery/readme.md
Examples:
1. For TEI `urn:tei:uuid:products.example.com:d4d9f54a-abcf-11ee-ac79-1a52914d44b`
`https://api.teaexample.com/v0.2.0-beta.2/discovery?tei=urn%3Atei%3Auuid%3Aproducts.example.com%3Ad4d9f54a-abcf-11ee-ac79-1a52914d44b`
`https://api.teaexample.com/v1.0.0/discovery?tei=urn%3Atei%3Auuid%3Aproducts.example.com%3Ad4d9f54a-abcf-11ee-ac79-1a52914d44b`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TEI is now URL

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This branch is still based on current main (URN). Would you prefer I update the TEI examples in this PR to the URL form now, or wait until #261 merges and then rebase/apply that change here?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait and rebase after merge of URN removal

Comment thread discovery/tea-well-known.schema.json Outdated
"1.0.0"
],
"description": "TEA OpenAPI Spec Version identifier, conforms to SemVer 2.0 (https://semver.org/)."
"description": "TEA OpenAPI Spec version identifier as full SemVer 2.0.0 MAJOR.MINOR.PATCH (https://semver.org/)."

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're changing regex to digits only but prose says "full SemVer". Full SemVer may have modifier and metadata. I suggest reverting this back actually and keeping previous regex (that was representing full SemVer per spec).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed.I’ll restore a SemVer-accurate pattern and keep the 1.0.0 examples

Comment thread spec/openapi.yaml Outdated
description: |
Supported TEA API versions at this server, without a leading `v`. Each value
is full SemVer 2.0.0 `MAJOR.MINOR.PATCH`. Clients select the highest mutually
supported version and append `/v` followed by that exact string.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See previous comment re: SemVer.

Comment thread spec/openapi.yaml
example: ["0.2.0-beta.2", "1.0.0"]
pattern: '^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$'
description: TEA OpenAPI Spec version identifier (SemVer 2.0.0 MAJOR.MINOR.PATCH)
example: ["1.0.0"]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See previous comment re: SemVer.

@Mehrn0ush

Copy link
Copy Markdown
Contributor Author

Thanks @taleodor — pushed a follow-up for the vocabulary and semVer;
On TEI-as-URL: as this branch is still on current main (URN). Happy to either wait for #261 to merge and then rebase, or update the TEI examples here now if you’d rather not wait — which do you recommend?

Signed-off-by: Mehrn0ush <mehrnoush.vaseghi@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Align TEA API version grammar and /v{version} URL construction

3 participants