Skip to content

Use logical values for TEI, PURL, and mediaType query params - #284

Open
Mehrn0ush wants to merge 2 commits into
CycloneDX:mainfrom
Mehrn0ush:docs/fix-query-parameter-double-encoding
Open

Mehrn0ush wants to merge 2 commits into
CycloneDX:mainfrom
Mehrn0ush:docs/fix-query-parameter-double-encoding

Conversation

@Mehrn0ush

Copy link
Copy Markdown
Contributor

Summary

Stop putting percent-encoded forms in OpenAPI parameter examples so
clients do not double-encode. Document one-shot query serialization
and show wire forms only in serialized request examples. Closes CycloneDX#283.

Signed-off-by: Mehrn0ush <mehrnoush.vaseghi@gmail.com>

@taleodor taleodor left a comment

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.

Generally agree with direction, but this should be rebased after #261 merges.

Comment thread spec/openapi.yaml Outdated
schema:
type: string
example: urn%3Atei%3Auuid%3Aproducts.example.com%3Ad4d9f54a-abcf-11ee-ac79-1a52914d44b
example: urn:tei:uuid:products.example.com:d4d9f54a-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.

this needs to use new URI syntax

@Mehrn0ush

Copy link
Copy Markdown
Contributor Author

Thanks @taleodor — agreed. I’ll hold this until #261 merges, then rebase and switch the tei example to the new URI syntax.

@oej oej left a comment

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.

Looks good to me. Normative changes, so urgency

@taleodor

Copy link
Copy Markdown
Contributor

See below - generally, 2 and 3 should be addressed, then we should wait on #261 merge before merging this.

1. This collides with #261 on the same line, and carries the URN form. This PR sets:

example: urn:tei:uuid:products.example.com:d4d9f54a-abcf-11ee-ac79-1a52914d44b

while #261 sets that same line to tei://products.example.com/uuid/47f51950-…. It also adds a new URN reference in the serialization block at line 782, which #261 will make stale. Merge order matters: land #261 first, then rebase this and switch both the example and the serialization line to the tei:// form. If this lands first, whoever resolves the conflict has to remember not to keep the URN form.

2. The truncated UUID is being propagated. d4d9f54a-abcf-11ee-ac79-1a52914d44b has 11 hex digits in the final group rather than 12. This PR now carries it in two places: the example value and line 782. It is the same defect flagged on #261 lines 333-334, so it is worth fixing here rather than copying it forward — #261's replacement UUID is already correct.

3. Keyword inconsistency within the PR. The tei and purl parameters use singular example: under schema:, while the two mediaType parameters use the array form:

schema:
  type: string
  examples:
    - application/vnd.cyclonedx+json

The file declares jsonSchemaDialect: …/2020-12, where a Schema Object's keyword is examples (an array); example is the legacy OpenAPI spelling. Since both halves of this PR touch the same concern, harmonising on examples: would be a two-line change, and it matches what #264 does across the component schemas.

Complete the discovery TEI UUID to 12 hex digits in the last
group, and use examples: for tei/purl to match mediaType and the
2020-12 dialect. tei:// form still waits on CycloneDX#261.

Signed-off-by: Mehrn0ush <mehrnoush.vaseghi@gmail.com>
@Mehrn0ush

Copy link
Copy Markdown
Contributor Author

Thanks,
Addressed (2) and (3) in a follow-up commit:
full UUID (…44b1) in both places, and examples: for tei/purl. Still holding the tei:// switch and merge until #261 lands, then will rebase.

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.

Avoid double-encoding of TEI, PURL, and mediaType query parameters

3 participants