# Validating OpenAPI / Swagger on https://docs.discourse.org/openapi.json

**URL:** <https://meta.discourse.org/t/validating-openapi-swagger-on-https-docs-discourse-org-openapi-json/169612>\
**Category:** Bug\
**Tags:** rest-api\
**Created:** [November 9, 2020, 2:47pm UTC](https://meta.discourse.org/t/validating-openapi-swagger-on-https-docs-discourse-org-openapi-json/169612 "2020-11-09T14:47:44Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![guidoleenders](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/guidoleenders/32/196268_2.png) [@guidoleenders](https://meta.discourse.org/u/guidoleenders)\
**Post date:** [November 9, 2020, 2:47pm UTC](https://meta.discourse.org/t/validating-openapi-swagger-on-https-docs-discourse-org-openapi-json/169612/1 "2020-11-09T14:47:44Z")

</div>

The swagger on [https://docs.discourse.org/openapi.json](https://docs.discourse.org/openapi.json) is not valid it seems.

Reproduction scenario:

- Go to [https://editor.swagger.io/](https://editor.swagger.io/)
- Click on File → Import URL.
- Enter the URL.

After a few seconds, 142 validation errors occur.

Can not attach, but resembles:

```plaintext
Structural error at paths./categories.json.post.responses.200.content.application/json.schema.properties.category.properties.name.description
should be string
Jump to line 184
Structural error at paths./categories.json.post.responses.200.content.application/json.schema.properties.category.properties.color.description
should be string
Jump to line 187
Structural error at paths./categories.json.post.responses.200.content.application/json.schema.properties.category.properties.text_color.description
should be string
Jump to line 190
... more ...

```

Is there an alternative (validating) swagger definition available?

# Suggested patch

The following is a suggested patch sofar.

> **Samenvatting**
>
> ```patch
> diff --git "a/discourse-swagger-original.json" "b/discourse-swagger.json"
> index f9267f5d0..dcebe3fd8 100644
> --- "a/discourse-swagger-original.json"
> +++ "b/discourse-swagger.json"
> @@ -578,8 +578,8 @@
> },
> "available_groups": {
> "type": "array",
> - "uniqueItems": null,
> - "minItems": null,
> + "uniqueItems": false,
> + "minItems": 0,
> "items": {
> "type": "object"
> }
> @@ -1196,8 +1196,8 @@
> },
> "actions_summary": {
> "type": "array",
> - "uniqueItems": null,
> - "minItems": null,
> + "uniqueItems": false,
> + "minItems": 0,
> "items": {
> "type": "object"
> }
> @@ -1788,8 +1788,8 @@
> },
> "actions_summary": {
> "type": "array",
> - "uniqueItems": null,
> - "minItems": null,
> + "uniqueItems": false,
> + "minItems": 0,
> "items": {
> "type": "object"
> }
> @@ -1885,8 +1885,8 @@
> },
> "stream": {
> "type": "array",
> - "uniqueItems": null,
> - "minItems": null,
> + "uniqueItems": false,
> + "minItems": 0,
> "items": {
> "type": "object"
> }
> @@ -1899,14 +1899,14 @@
> },
> "timeline_lookup": {
> "type": "array",
> - "uniqueItems": null,
> - "minItems": null,
> + "uniqueItems": false,
> + "minItems": 0,
> "items": {
> "properties": {
> "0": {
> "type": "array",
> "uniqueItems": true,
> - "minItems": null,
> + "minItems": 0,
> "items": {
> "type": "object"
> }
> @@ -3621,8 +3621,8 @@
> "properties": {
> "user_badges": {
> "type": "array",
> - "uniqueItems": null,
> - "minItems": null,
> + "uniqueItems": false,
> + "minItems": 0,
> "items": {
> "type": "object"
> }
> @@ -3798,8 +3798,8 @@
> },
> "featured_user_badge_ids": {
> "type": "array",
> - "uniqueItems": null,
> - "minItems": null,
> + "uniqueItems": false,
> + "minItems": 0,
> "items": {
> "type": "object"
> }
> @@ -3864,8 +3864,8 @@
> "properties": {
> "user_badges": {
> "type": "array",
> - "uniqueItems": null,
> - "minItems": null,
> + "uniqueItems": false,
> + "minItems": 0,
> "items": {
> "type": "object"
> }
> @@ -4041,8 +4041,8 @@
> },
> "featured_user_badge_ids": {
> "type": "array",
> - "uniqueItems": null,
> - "minItems": null,
> + "uniqueItems": false,
> + "minItems": 0,
> "items": {
> "type": "object"
> }
> @@ -4734,8 +4734,8 @@
> },
> "posters": {
> "type": "array",
> - "uniqueItems": null,
> - "minItems": null,
> + "uniqueItems": false,
> + "minItems": 0,
> "items": {
> "type": "object"
> }
> @@ -4745,16 +4745,16 @@
> },
> "users": {
> "type": "array",
> - "uniqueItems": null,
> - "minItems": null,
> + "uniqueItems": false,
> + "minItems": 0,
> "items": {
> "type": "object"
> }
> },
> "categories": {
> "type": "array",
> - "uniqueItems": null,
> - "minItems": null,
> + "uniqueItems": false,
> + "minItems": 0,
> "items": {
> "type": "object"
> }
> @@ -4773,24 +4773,24 @@
> },
> "post_ids": {
> "type": "array",
> - "uniqueItems": null,
> - "minItems": null,
> + "uniqueItems": false,
> + "minItems": 0,
> "items": {
> "type": "object"
> }
> },
> "user_ids": {
> "type": "array",
> - "uniqueItems": null,
> - "minItems": null,
> + "uniqueItems": false,
> + "minItems": 0,
> "items": {
> "type": "object"
> }
> },
> "category_ids": {
> "type": "array",
> - "uniqueItems": null,
> - "minItems": null,
> + "uniqueItems": false,
> + "minItems": 0,
> "items": {
> "type": "object"
> }
> @@ -6406,8 +6406,8 @@
> },
> "owners": {
> "type": "array",
> - "uniqueItems": null,
> - "minItems": null,
> + "uniqueItems": false,
> + "minItems": 0,
> "items": {
> "type": "object"
> }
> @@ -7241,8 +7241,8 @@
> },
> "choices": {
> "type": "array",
> - "uniqueItems": null,
> - "minItems": null,
> + "uniqueItems": false,
> + "minItems": 0,
> "items": {
> "type": "object"
> }
> 
> ```

---

_[View the full topic](https://meta.discourse.org/t/validating-openapi-swagger-on-https-docs-discourse-org-openapi-json/169612)._
