# Discourse openapi.json Docs does not follow OpenAPI 3.1.0 spec

**URL:** https://meta.discourse.org/t/discourse-openapi-json-docs-does-not-follow-openapi-3-1-0-spec/268932
**Category:** Bug
**Tags:** rest-api
**Created:** [June 19, 2023, 6:06pm UTC](https://meta.discourse.org/t/discourse-openapi-json-docs-does-not-follow-openapi-3-1-0-spec/268932 "2023-06-19T18:06:03Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Kyle-Ye](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kyle-ye/32/309787_2.png) [@Kyle-Ye](https://meta.discourse.org/u/Kyle-Ye)
#### Post date: [June 19, 2023, 6:06pm UTC](https://meta.discourse.org/t/discourse-openapi-json-docs-does-not-follow-openapi-3-1-0-spec/268932/1 "2023-06-19T18:06:04Z")

</div>

> I’m not sure if this is the best place to submit such feedback, but the relevant Github repository has closed the Issue submission portal, so I try to give feedback here.  
> [GitHub - discourse/discourse\_api\_docs: Discourse API Documentation · GitHub](https://github.com/discourse/discourse_api_docs)

The openapi.json file hosted at [GitHub - discourse/discourse\_api\_docs: Discourse API Documentation · GitHub](https://github.com/discourse/discourse_api_docs) is actually not a valid openapi file.

See more info here [Discourse openapi.json generate issue · Issue #277 · mattpolzin/OpenAPIKit · GitHub](https://github.com/mattpolzin/OpenAPIKit/issues/277)

TL,DR 👇

> The `items` key for an `array` schema `"MUST be a valid JSON Schema"` ([json-schema.org/draft/2020-12/json-schema-core.html#section-10.3.1.2-1](https://json-schema.org/draft/2020-12/json-schema-core.html#section-10.3.1.2-1)) and a JSON Schema `"MUST be an object or a boolean"` ([json-schema.org/draft/2020-12/json-schema-core.html#section-4.3-2](https://json-schema.org/draft/2020-12/json-schema-core.html#section-4.3-2)). Because this part of the OpenAPI Document is governed by JSON Schema rules, they likely don’t bother mentioning too many of those rules inside the OpenAPI specification itself.

---

<div class="post-metadata">

### Author: ![Kyle-Ye](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kyle-ye/32/309787_2.png) [@Kyle-Ye](https://meta.discourse.org/u/Kyle-Ye)
#### Post date: [June 19, 2023, 6:15pm UTC](https://meta.discourse.org/t/discourse-openapi-json-docs-does-not-follow-openapi-3-1-0-spec/268932/2 "2023-06-19T18:15:01Z")

</div>

Discourse’s openapi.json is generated by a tool named [rswag](https://github.com/rswag/rswag)

Maybe this is an upstream issue. And when upstream fix it, we should upgrade the dependency version and update the corresponding doc files.

[https://github.com/rswag/rswag/issues/647](https://github.com/rswag/rswag/issues/647)

---

<div class="post-metadata">

### Author: ![blake](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blake/32/157322_2.png) [@blake](https://meta.discourse.org/u/blake)
#### Post date: [April 3, 2024, 4:59pm UTC](https://meta.discourse.org/t/discourse-openapi-json-docs-does-not-follow-openapi-3-1-0-spec/268932/3 "2024-04-03T16:59:13Z")

</div>

PR above ^ was actually addressed downstream here:

[https://github.com/discourse/discourse/pull/22256](https://github.com/discourse/discourse/pull/22256)

---

<div class="post-metadata">

### Author: ![blake](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blake/32/157322_2.png) [@blake](https://meta.discourse.org/u/blake)
#### Post date: [April 3, 2024, 4:59pm UTC](https://meta.discourse.org/t/discourse-openapi-json-docs-does-not-follow-openapi-3-1-0-spec/268932/4 "2024-04-03T16:59:15Z")

</div>


