Harmonise operationIds in openapi.yaml
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Refactor
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- openapi
- Domain
- api
Research direction
Start with spec/openapi.yaml and compare the operationId table against the two proposed schemes. Resolve whether Scheme A or Scheme B is preferred, then apply that convention to the current specification while leaving archive/legacy_consumer_spec/ unchanged. Done means the selected naming scheme is consistent across the listed operations and its breaking impact before 1.0 is understood.
Written by the indexing model from the issue text.
Description
Problem
operationId values in spec/openapi.yaml mix four different conventions. Since operationIds become method names in every generated client, this inconsistency is visible to all API consumers.
- The
Teaprefix appears in 7 of 30 operations (getTeaProductByUuid,queryTeaComponents) and is absent from the rest (getComponentReleaseById,getLatestArtifact). - The same kind of lookup is suffixed
ByUuidfor products and product releases butByIdfor components and component releases. - Component release is the unmarked default for collection operations (
getLatestCollection,getCollectionsByReleaseId,getCollection), while the product side is qualified (getLatestCollectionForProductRelease,getCollectionsByProductReleaseId,getCollectionForProductRelease). Nothing in the paths justifies the asymmetry. discoveryByTeiis a noun rather than a verb and is inaccurate, since the endpoint also acceptspurl.
Proposal
Two candidate schemes are shown below. Either one is acceptable; the point is to pick one and apply it everywhere.
Scheme A, parent-first. <verb><Parent><Child>[ByVersion]. No Tea prefix, no ById suffix on single-item lookups. Verbs: query for top-level searches, list for parent-scoped listings, get for a single item, download for content. Latest goes before the noun and ByVersion after it, as the artifact operations already do. (list could be replaced by get, since the plural noun already carries cardinality; the only cost is that getProductReleases and queryProductReleases then read almost the same.)
Scheme B, Spring Data style. <verb><Subject>By<Property>[And<Property>], as in Spring Data derived query methods: the subject names what is returned, the predicate after By names the path or query parameters used to select it. This is the convention the current getReleasesByProductId and getCleByProductReleaseId already follow. Cardinality is carried by the subject noun, not by the verb, so get is used throughout for reads and download for content.
| Path | Current | A: parent-first | B: Spring Data style |
|---|---|---|---|
/products |
queryTeaProducts |
queryProducts |
getProductsByIdentifier |
/product/{uuid} |
getTeaProductByUuid |
getProduct |
getProductByUuid |
/product/{uuid}/releases |
getReleasesByProductId |
listProductReleases |
getReleasesByProductUuid |
/product/{uuid}/cle |
getCleByProductId |
getProductCle |
getCleByProductUuid |
/productReleases |
queryTeaProductReleases |
queryProductReleases |
getProductReleasesByIdentifier |
/productRelease/{uuid} |
getTeaProductReleaseByUuid |
getProductRelease |
getProductReleaseByUuid |
/productRelease/{uuid}/cle |
getCleByProductReleaseId |
getProductReleaseCle |
getCleByProductReleaseUuid |
/productRelease/{uuid}/collections |
getCollectionsByProductReleaseId |
listProductReleaseCollections |
getCollectionsByProductReleaseUuid |
/productRelease/{uuid}/collection/latest |
getLatestCollectionForProductRelease |
getLatestProductReleaseCollection |
getLatestCollectionByProductReleaseUuid |
/productRelease/{uuid}/collection/{collectionVersion} |
getCollectionForProductRelease |
getProductReleaseCollectionByVersion |
getCollectionByProductReleaseUuidAndVersion |
/components |
queryTeaComponents |
queryComponents |
getComponentsByIdentifier |
/component/{uuid} |
getTeaComponentById |
getComponent |
getComponentByUuid |
/component/{uuid}/releases |
getReleasesByComponentId |
listComponentReleases |
getReleasesByComponentUuid |
/component/{uuid}/cle |
getCleByComponentId |
getComponentCle |
getCleByComponentUuid |
/componentReleases |
queryTeaComponentReleases |
queryComponentReleases |
getComponentReleasesByIdentifier |
/componentRelease/{uuid} |
getComponentReleaseById |
getComponentRelease |
getComponentReleaseByUuid |
/componentRelease/{uuid}/cle |
getCleByComponentReleaseId |
getComponentReleaseCle |
getCleByComponentReleaseUuid |
/componentRelease/{uuid}/collections |
getCollectionsByReleaseId |
listComponentReleaseCollections |
getCollectionsByComponentReleaseUuid |
/componentRelease/{uuid}/collection/latest |
getLatestCollection |
getLatestComponentReleaseCollection |
getLatestCollectionByComponentReleaseUuid |
/componentRelease/{uuid}/collection/{collectionVersion} |
getCollection |
getComponentReleaseCollectionByVersion |
getCollectionByComponentReleaseUuidAndVersion |
/artifact/{uuid}/latest |
getLatestArtifact |
unchanged | getLatestArtifactByUuid |
/artifact/{uuid}/{artifactVersion} |
getArtifactByVersion |
unchanged | getArtifactByUuidAndVersion |
/artifact/{uuid}/latest/download |
downloadLatestArtifact |
unchanged | downloadLatestArtifactByUuid |
/artifact/{uuid}/{artifactVersion}/download |
downloadArtifactByVersion |
unchanged | downloadArtifactByUuidAndVersion |
/artifact/{uuid}/latest/signature/download |
downloadLatestArtifactSignature |
unchanged | downloadLatestArtifactSignatureByUuid |
/artifact/{uuid}/{artifactVersion}/signature/download |
downloadArtifactSignatureByVersion |
unchanged | downloadArtifactSignatureByUuidAndVersion |
/token |
requestToken |
unchanged | unchanged |
/discovery |
discoveryByTei |
discover |
discover |
Trade-offs:
- Scheme A changes 21 operationIds and leaves the artifact and token operations untouched. Names stay short.
- Scheme B changes 27 operationIds, including all six artifact operations, and names grow long once two parameters are involved. In exchange every name states exactly which parameters select the result, and the style matches what half of the file already does.
Impact
Breaking for generated clients built from 0.x specs, since method names change. This should land before 1.0. The archived 0.2.0 spec under archive/legacy_consumer_spec/ keeps its current operationIds.
- Dominant language
- Shell
- Stars
- 120
- Forks
- 24
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 67
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from CycloneDX/transparency-exchange-api
-
Shorten and simplify clause 5 discoveryPossibly taken @oej claimed this 10 days ago. OpenTEI Discovery
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
CycloneDX/transparency-exchange-api#392 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
-
Definition/explanation should come before usePossibly taken @oej claimed this 10 days ago. OpenTEI Discovery
Difficulty 1/5 Under an hour Newbie friendliness 90/100
CycloneDX/transparency-exchange-api#391 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
-
Backlog
Difficulty 1/5 Under an hour Newbie friendliness 85/100
CycloneDX/transparency-exchange-api#343 · 2 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
Prio 1 TEI Discovery
Difficulty 2/5 1-3 hours Newbie friendliness 58/100
CycloneDX/transparency-exchange-api#404 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
-
Prio 1 TEI Discovery
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
CycloneDX/transparency-exchange-api#390 · 1 comment ·
Maintainers usually reply within 1 day
All issues in CycloneDX/transparency-exchange-api
Similar issues
-
documentation needs-triage priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
yeongseon/azure-functions-validation-python#546 ·
Maintainers usually reply within 1 day
-
help wanted new command
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
tldr-pages/tldr#24755 ·
Maintainers usually reply within 1 day
-
afk-ok area:agents size:S
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
enorm-labs/event-junkie#3523 ·
Maintainers usually reply within 1 day
-
Container fails to start when a mounted neo4j.conf uses spaces around `=`Possibly taken @RaphaelFakhri claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
neo4j/docker-neo4j#596 ·
-
documentation good first issue
Difficulty 2/5 Half a day Newbie friendliness 78/100
devdavidejesus/btc-toolkit#63 ·
Maintainers usually reply within 1 day