Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions assets/fingerprinted/css/openapi.css
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,36 @@
font-size: 0.9rem;
}

/* Request body block: bordered card so the body's fields are visually nested
under the Request Body heading instead of sitting flush with the section's
top-level Request Parameters list. */

.api-request-body {
margin: 1rem 0 1.25rem;
padding: 0.75rem 1rem;
border: 1px solid #eaeaea;
border-radius: 4px;
background: #fff;
}

.api-request-body .api-params {
margin-top: 0.5rem;
border-top: none;
}

.api-request-body .api-param:first-child {
padding-top: 0;
}

.api-request-body .api-param:last-child {
border-bottom: none;
padding-bottom: 0;
}
Comment thread
djgrove marked this conversation as resolved.
Outdated

.api-request-body .api-schema-label {
margin-top: 0;
}

/* Response blocks: one per inline-rendered status (2xx, or 4xx/5xx with a
schema). Stock errors collapse into .api-response-errors below. */

Expand Down
40 changes: 22 additions & 18 deletions layouts/partials/openapi/endpoint.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,37 +52,41 @@ <h4>Request Body</h4>
{{ $schemaDetails = index $.openapi.components.schemas $schemaName }}
{{ end }}
{{ if $schemaDetails }}
<div class="api-schema-label">Schema: <a href="/docs/reference/cloud-rest-api/schema/{{ $schemaName | urlize }}/">{{ $schemaName }}</a></div>
{{ $resolved := partial "openapi/resolve-schema.html" (dict "schema" $schemaDetails "openapi" $.openapi) }}
{{ if $resolved.properties }}
<div class="api-request-body">
<div class="api-schema-label">Schema: <a href="/docs/reference/cloud-rest-api/schema/{{ $schemaName | urlize }}/">{{ $schemaName }}</a></div>
{{ $resolved := partial "openapi/resolve-schema.html" (dict "schema" $schemaDetails "openapi" $.openapi) }}
{{ if $resolved.properties }}
<ul class="api-params">
{{ partial "openapi/property-rows.html" (dict
Comment thread
djgrove marked this conversation as resolved.
Outdated
"properties" $resolved.properties
"required" $resolved.required
"openapi" $.openapi
"depth" 0
"maxDepth" 1
) }}
</ul>
{{ end }}
</div>
{{ end }}
{{ else }}
{{ $resolved := partial "openapi/resolve-schema.html" (dict "schema" $schema "openapi" $.openapi) }}
{{ if $resolved.properties }}
<div class="api-request-body">
<ul class="api-params">
{{ partial "openapi/property-rows.html" (dict
"properties" $resolved.properties
"required" $resolved.required
"required" ($resolved.required | default slice)
"openapi" $.openapi
"depth" 0
"maxDepth" 1
) }}
</ul>
{{ end }}
</div>
{{ end }}
{{ else }}
{{ $resolved := partial "openapi/resolve-schema.html" (dict "schema" $schema "openapi" $.openapi) }}
{{ if $resolved.properties }}
<ul class="api-params">
{{ partial "openapi/property-rows.html" (dict
"properties" $resolved.properties
"required" ($resolved.required | default slice)
"openapi" $.openapi
"depth" 0
"maxDepth" 1
) }}
</ul>
{{ end }}
{{ end }}
{{ end }}
{{ end }}
{{ end }}

{{/* Request/response examples hidden for now — revisit once example
quality is validated across the full public spec. */}}
Expand Down
Loading