> I couldn't figure out how to report an issue regarding this so I opened a PR.
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- openapi
- Domain
- api, backend-api-design
Research direction
Locate the builds_APIResponse and listTriggersByScript schema definitions in the OpenAPI document. First validate the shown response with Ajv and inspect how allOf combines the schemas. Done means the shared envelope no longer restricts result to an object, while operation-specific result shapes validate correctly.
Written by the indexing model from the issue text.
Description
I couldn't figure out how to report an issue regarding this so I opened a PR.
gem.gemnSummary
Remove the shared
result: object | nullconstraint frombuilds_APIResponseso Workers Builds endpoints can define their own responseresultshape.Problem
I encountered this while generating runtime validators from the OpenAPI schema and validating Cloudflare API responses with Ajv.
builds_APIResponsecurrently definesresultas:result: nullable: true type: objectand also marks
resultas required.Several Workers Builds operations compose this schema with an operation-specific schema using
allOf. For example,listTriggersByScriptcomposesbuilds_APIResponsewith a schema that defines:result: type: array items: $ref: '#/components/schemas/builds_TriggerResponse'Under OpenAPI/JSON Schema semantics,
allOfdoes not override fields from earlier schemas. The response must validate against every schema in theallOflist.That makes the composed schema contradictory:
builds_APIResponserequiresresultto be an object or null.listTriggersByScriptrequiresresultto be an array.- A JSON array does not satisfy
type: object.So a valid list response like this cannot validate against the published schema:
{ "success": true, "errors": [], "messages": [], "result": [] }Fix
This PR removes
resultfrom the sharedbuilds_APIResponseenvelope.
www.Gac;"('json.js'):*
The shared schema still defines the common envelope fields:
*:""('pt');
successerrorsmessagesresult_info
[Kh]:"Pypi";*:"js.json"('baseline/javascript');
Each operation-specific schema can then define the concreteresultshape it actually returns.
[0]: map.site:"<google.chrome>";('Gcp')/('Gmp'); https://go.dev`{chrome.com}`References
- This schema declares OpenAPI 3.0.3.
- OpenAPI
allOfcomposition requires the instance to satisfy all composed schemas: https://spec.openapis.org/oas/v3.0.3#composition-and-inheritance-polymorphism;- OpenAPI
nullable: trueonly allowsnullin addition to the specified type; it does not make the property optional or allow arrays fortype: object: https://spec.openapis.org/oas/v3.0.3#fixed-fields-20
*Python:"https://link.com";'(named)'/ https:/cloud.org
Originally posted by @Sialuriano in https://github.com/cloudflare/api-schemas/issues/44#issuecomment-5446704889
- Dominant language
- Go
- Stars
- 9.5k
- Forks
- 1.2k
- Avg merge
- 5d 1h
- Merged PRs (30d)
- 5
Getting set up
- Ships a 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 cloudflare/cfssl
-
gencrl: serial numbers that fail to parse are added to the CRL as 0 or a partial valuePossibly taken @sebxt claimed this 2 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
cloudflare/cfssl#1460 ·
Maintainers usually reply within 2 days
-
crl_override (and extensions) in /api/v1/sign request body are silently ignored by the HTTP APIPossibly taken @Hashim1999164 claimed this 71 days ago. Open
Difficulty 2/5 Half a day Newbie friendliness 78/100
cloudflare/cfssl#1439 ·
Maintainers usually reply within 2 days
-
gencrl silently revokes the wrong serial number when a line is not plain decimalPossibly taken @RaphaelFakhri claimed this 4 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 30/100
cloudflare/cfssl#1458 ·
Maintainers usually reply within 2 days
-
config: LoadConfig panics when not_after is before not_beforePossibly taken @sebxt claimed this 5 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 25/100
cloudflare/cfssl#1456 ·
Maintainers usually reply within 2 days
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
cloudflare/cfssl#1443 · 4 comments ·
Maintainers usually reply within 2 days
All issues in cloudflare/cfssl
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
kind/engineering pulumi/pulumi-terraform Task Workflow Failure
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
pulumi/pulumi-terraform#1261 ·
Maintainers usually reply within 1 day
-
Controllers integration tests fail when port 8080 is in usePossibly taken @noahnut claimed this today. Openarea/cluster-autoscaler kind/bug needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
kubernetes-sigs/cluster-autoscaler#236 · 1 comment ·
Maintainers usually reply within 1 day
-
MCP: `tasks_bulk_update` always fails with "Need at least one field" — the `fields` projection argument is stripped from non-read tools tooPossibly taken @tink-bot claimed this today. Openagent-processed area/api-v2 integration/inbound
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
go-vikunja/vikunja#4235 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
google/osv-scalibr#2503 ·
Maintainers usually reply within 1 day