Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
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
37 changes: 23 additions & 14 deletions assets/fingerprinted/css/openapi.css
Original file line number Diff line number Diff line change
Expand Up @@ -337,9 +337,11 @@
font-size: 0.9rem;
}

/* Response blocks: one per inline-rendered status (2xx, or 4xx/5xx with a
schema). Stock errors collapse into .api-response-errors below. */
/* Bordered card used for the Request Body and each Response. Both nest a
field list (.api-params) under a section heading; sharing the selector
keeps them visually in lockstep. */

.api-request-body,
.api-response {
margin: 1rem 0 1.25rem;
padding: 0.75rem 1rem;
Expand All @@ -348,6 +350,23 @@
background: #fff;
}

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

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

.api-request-body .api-param:last-child,
.api-response .api-param:last-child {
border-bottom: none;
padding-bottom: 0;
}

.api-response-header {
display: flex;
align-items: baseline;
Expand Down Expand Up @@ -380,18 +399,8 @@
color: #5b3fa3;
}

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

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

.api-response .api-param:last-child {
border-bottom: none;
padding-bottom: 0;
.api-request-body .api-schema-label {
margin-top: 0;
}

/* Status chip: compact pill showing HTTP status code with semantic color. */
Expand Down
40 changes: 3 additions & 37 deletions layouts/partials/openapi/endpoint.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,46 +43,12 @@ <h3 id="{{ anchorize (printf "%s-%s" .method .path) }}">{{ $displayName }}</h3>
{{ $schema := .schema }}
{{ if $schema }}
<h4>Request Body</h4>
{{ if isset $schema "$ref" }}
{{ $refPath := index $schema "$ref" }}
{{ $refParts := split $refPath "/" }}
{{ $schemaName := index $refParts (sub (len $refParts) 1) }}
{{ $schemaDetails := "" }}
{{ if isset $.openapi.components.schemas $schemaName }}
{{ $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 }}
<ul class="api-params">
{{ partial "openapi/property-rows.html" (dict
"properties" $resolved.properties
"required" $resolved.required
"openapi" $.openapi
"depth" 0
"maxDepth" 1
) }}
</ul>
{{ end }}
{{ 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 }}
<div class="api-request-body">
{{ template "openapi/response-schema.html" (dict "schema" $schema "openapi" $.openapi) }}
</div>
Comment thread
djgrove marked this conversation as resolved.
{{ end }}
{{ end }}
{{ end }}
{{ end }}

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