Skip to content

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

Merged
oej merged 1 commit into
CycloneDX:mainfrom
Mehrn0ush:docs/fix-query-parameter-double-encoding
Sep 16, 2026
Merged

oej merged 1 commit into
CycloneDX:mainfrom
Mehrn0ush:docs/fix-query-parameter-double-encoding

Conversation

@Mehrn0ush

Copy link
Copy Markdown
Contributor

Summary

@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.

@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.

@oej

oej commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator

#261 is now merged, so let's focus on fixing and merging this

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>
@Mehrn0ush
Mehrn0ush force-pushed the docs/fix-query-parameter-double-encoding branch from 638ccc7 to 7d6105e Compare September 16, 2026 07:58
@Mehrn0ush

Copy link
Copy Markdown
Contributor Author

Rebased onto main after #261. TEI examples now use tei:// (logical + serialized); kept examples: and one-shot encoding guidance.

@oej
oej merged commit e326867 into CycloneDX:main Sep 16, 2026
2 checks passed
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