Summary
The OpenAPI spec generated by ocm-api-metamodel doesn’t currently emit the "required": true flag on operation requestBody objects. For endpoints where the request body is mandatory (e.g., cluster registration), this results in a less strict schema for clients and validators.
Impact
Client SDKs and validators may treat the request body as optional.
This is inconsistent with common OpenAPI practices where mandatory bodies are explicitly marked as required.
Context
This was noticed while adding POST /api/clusters_mgmt/v1/register_cluster in ocm-api-model (see backlinks).
Requested outcome
Provide a way in ocm-api-metamodel for an operation’s request body to be marked as required so the generator can emit: "requestBody": { "required": true, ... }.
If a global convention is preferred, consider an approach that ensures endpoints with mandatory bodies are consistently marked as required across the spec.
Backlinks
PR in ocm-api-model: #1158
Review comment: #1158 (comment)
Summary
The OpenAPI spec generated by ocm-api-metamodel doesn’t currently emit the "required": true flag on operation requestBody objects. For endpoints where the request body is mandatory (e.g., cluster registration), this results in a less strict schema for clients and validators.
Impact
Client SDKs and validators may treat the request body as optional.
This is inconsistent with common OpenAPI practices where mandatory bodies are explicitly marked as required.
Context
This was noticed while adding POST /api/clusters_mgmt/v1/register_cluster in ocm-api-model (see backlinks).
Requested outcome
Provide a way in ocm-api-metamodel for an operation’s request body to be marked as required so the generator can emit: "requestBody": { "required": true, ... }.
If a global convention is preferred, consider an approach that ensures endpoints with mandatory bodies are consistently marked as required across the spec.
Backlinks
PR in ocm-api-model: #1158
Review comment: #1158 (comment)