Skip to content

Commit 7eab10c

Browse files
Update API docs in IDP (#31381)
* Update API docs in IDP * Apply suggestions from docs review Co-authored-by: Ursula Chen <[email protected]> --------- Co-authored-by: Ursula Chen <[email protected]>
1 parent 609685e commit 7eab10c

File tree

1 file changed

+33
-1
lines changed
  • content/en/internal_developer_portal/software_catalog/entity_model

1 file changed

+33
-1
lines changed

content/en/internal_developer_portal/software_catalog/entity_model/entity_types.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,11 @@ In Software Catalog, an API (`kind:API`) refers to a collection of endpoints tha
9090

9191
To define components within an API, you can specify values for the `components` key in the `spec` field of the entity's v3 definition.
9292

93-
Example YAML for `kind:api`:
93+
You can also include an OpenAPI spec in your entity definition in two ways: inline, or through a file reference.
94+
95+
**Inline:**
96+
Add the OpenAPI definition under the spec field using `type: openapi`.
97+
9498
{{< code-block lang="yaml" filename="entity.datadog.yaml" collapsible="true" >}}
9599
{
96100
"apiVersion": "v3",
@@ -182,6 +186,34 @@ Example YAML for `kind:api`:
182186
}
183187
{{< /code-block >}}
184188

189+
**File reference:**
190+
191+
Point to an OpenAPI file stored in GitHub using the `fileref` field.
192+
193+
{{< code-block lang="yaml" filename="entity.datadog.yaml" collapsible="true" >}}
194+
{
195+
"apiVersion": "v3",
196+
"kind": "api",
197+
"metadata": {
198+
"name": "payments",
199+
"displayName": "Payments",
200+
"owner": "Payments Team",
201+
},
202+
"spec": {
203+
"type": "openapi",
204+
"implementedBy": [
205+
"service:payment",
206+
"service:payments-go"
207+
],
208+
"interface": {
209+
fileRef: https://github.com/openapi.yaml
210+
},
211+
"lifecycle": "production",
212+
"tier": "Tier 0"
213+
}
214+
}
215+
{{< /code-block >}}
216+
185217
The user-defined API appears in Software Catalog as shown:
186218
{{< img src="/tracing/software_catalog/api-page-v3.png" alt="API page for Payments API in Software Catalog" style="width:90%;" >}}
187219

0 commit comments

Comments
 (0)