You are browsing a read-only backup copy of Wikitech. The live site can be found at

User:Alex Paskulin/API catalog: Difference between revisions

From Wikitech-static
Jump to navigation Jump to search
imported>Alex Paskulin
(First draft of the API catalog page)
imported>Alex Paskulin
(Alex Paskulin moved page User:Alex Paskulin/API catalog to API catalog: Moving out of user page)
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
#REDIRECT [[API catalog]]
The API catalog is a list of Wikimedia APIs.
{{Clickable button 2|Browse the API catalog|class=mw-ui-progressive|url=}}
== About the API catalog ==
The API catalog is a project of the [[mw:Core_Platform_Team/Initiatives/API_Platform|API Platform Team]]. The purpose of the catalog is to help API producers and consumers, primarily within the Wikimedia Foundation, discover and manage APIs. The API catalog is currently in beta and uses the open-source [ Backstage] platform hosted on Toolforge.
Placeholder view vector.svg|API catalog
Placeholder view vector.svg|API overview
Placeholder view vector.svg|API definition
== Add an API to the catalog ==
To add an API to the catalog, add a catalog-info.yaml file to the root directory of your project repository. The API catalog automatically discovers catalog-info.yaml files in the Wikimedia production cluster(?).
=== catalog-info.yaml example ===
# Wikimedia API catalog descriptor file
kind: API
  name: example-api
  description: an example node api
    - rest
  type: openapi
  lifecycle: production
  owner: Platform Engineering Team
    $text: ./spec.yaml
=== catalog-info.yaml schema ===
For the complete schema, visit the [ Backstage docs].
{| class="wikitable" style="width: 100%;"
|style="width: 20%;"|<code>apiVersion</code>
<small>required | string</small>
| Must be <code></code>
| <code>kind</code>
<small>required | string</small>
| <code>API</code> for all APIs
| <code></code>
<small>required | string</small>
| Unique API name using lowercase letters and dashes
| <code>metadata.description</code>
<small>required | string</small>
| Short and informative overview of the API
| <code>metadata.tags</code>
<small>optional | list</small>
| List of tags to classify APIs by type and other attributes
* <code>rest</code>: tag for RESTful APIs
| <code>spec.type</code>
<small>required | string</small>
* <code>openapi</code> for an OpenAPI spec in YAML or JSON format (version 2 or 3)
* <code>graphql</code> for a GraphQL schema
For the complete list of supported types, visit the [ Backstage docs].
| <code>spec.lifecycle</code>
<small>required | string</small>
| To do: Add these
| <code>spec.owner</code>
<small>required | string</small>
| To do: Figure this out
| <code>spec.definition.$text</code>
<small>required | string</small>
| Location of the API spec relative to the project's root directory(?)
=== Alternative workflow: Manual upload ===
Instead of adding a file to the project repository, you can add an API to the catalog by uploading a catalog-info.yaml file to the Backstage repository [ data/apis directory].
== Frequently asked questions ==
== Questions and feedback ==
To share feedback or ask a question, comment on the talk page.

Latest revision as of 18:16, 12 January 2022

Redirect to: