Last active
March 18, 2024 18:16
-
-
Save baruchiro/3ed57844cb1da421094539d803379e7d to your computer and use it in GitHub Desktop.
An OpenAPI (Swagger) doc for the Wordpress API (api.wordpress.org)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
openapi: '3.0.3' | |
info: | |
title: Wordpress API | |
version: '1.0' | |
servers: | |
- url: https://api.wordpress.org/ | |
externalDocs: | |
description: Original documentation | |
url: https://codex.wordpress.org/WordPress.org_API | |
tags: | |
- name: plugins | |
description: Plugins | |
components: | |
schemas: | |
PluginInformation: | |
type: object | |
properties: | |
name: | |
type: string | |
slug: | |
type: string | |
version: | |
type: string | |
author: | |
type: string | |
author_profile: | |
type: string | |
requires: | |
type: string | |
tested: | |
type: string | |
requires_php: | |
type: string | |
requires_plugins: | |
type: array | |
rating: | |
type: integer | |
ratings: | |
type: object | |
properties: | |
'1': | |
type: integer | |
'2': | |
type: integer | |
'3': | |
type: integer | |
'4': | |
type: integer | |
'5': | |
type: integer | |
num_ratings: | |
type: integer | |
support_threads: | |
type: integer | |
support_threads_resolved: | |
type: integer | |
active_installs: | |
type: integer | |
downloaded: | |
type: integer | |
last_updated: | |
type: string | |
added: | |
type: string | |
homepage: | |
type: string | |
short-description: | |
type: string | |
description: | |
type: string | |
download_link: | |
type: string | |
tags: | |
type: object | |
donate_link: | |
type: string | |
icons: | |
type: object | |
paths: | |
/plugins/info/1.2/: | |
get: | |
summary: Get plugins info | |
description: Get plugins info | |
tags: | |
- plugins | |
parameters: | |
- name: action | |
in: query | |
description: Action | |
required: true | |
schema: | |
type: string | |
enum: | |
- query_plugins | |
- plugin_information | |
# For query_plugins | |
- name: browse | |
in: query | |
description: A bbPress View to “browse”, eg, “popular” = http://wordpress.org/extend/plugins/browse/popular/ | |
required: false | |
schema: | |
type: string | |
enum: | |
- popular | |
# TODO | |
- name: search | |
in: query | |
description: Search term | |
required: false | |
schema: | |
type: string | |
- name: tag | |
in: query | |
description: Tag slug | |
required: false | |
schema: | |
type: string | |
- name: author | |
in: query | |
description: Author slug | |
required: false | |
schema: | |
type: string | |
- name: page | |
in: query | |
description: Page number | |
required: false | |
schema: | |
type: integer | |
default: 1 | |
- name: per_page | |
in: query | |
description: Number of results to return per page | |
required: false | |
schema: | |
type: integer | |
- name: fields | |
in: query | |
description: This is a bit.. odd.. an array of which fields to return, the API has defaults for requests, but it can be overridden from the client, send an array with the field as the key, and true|false as the value to return or not | |
required: false | |
schema: | |
type: array | |
items: | |
type: string | |
enum: | |
- description | |
- sections | |
- tested | |
- requires | |
- rating | |
- downloaded | |
- downloadlink | |
- last_updated | |
- homepage | |
- tags | |
- versions | |
- contributors | |
# For plugin_information | |
- name: slug | |
in: query | |
description: Plugin slug | |
required: false | |
schema: | |
type: string | |
responses: | |
'200': | |
description: OK | |
content: | |
application/json: | |
schema: | |
type: object | |
properties: | |
info: | |
type: object | |
properties: | |
page: | |
type: integer | |
pages: | |
type: integer | |
results: | |
type: integer | |
plugins: | |
type: array | |
items: | |
$ref: '#/components/schemas/PluginInformation' | |
# TODO: get previous version of plugin | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment