Skip to content

Commit

Permalink
Convert from swagger to openapi 3
Browse files Browse the repository at this point in the history
  • Loading branch information
oblakeerickson committed Apr 17, 2020
1 parent 20f9a75 commit 9d688aa
Show file tree
Hide file tree
Showing 35 changed files with 37,788 additions and 37,410 deletions.
25 changes: 1 addition & 24 deletions README.md
Expand Up @@ -4,34 +4,11 @@ To view the the Discourse API Documentation you can visit:

http://docs.discourse.org/

Here is an example of what the ReDoc site looks like:

![redoc](https://cloud.githubusercontent.com/assets/1490496/20266324/e818b49e-aa32-11e6-8390-242f0f155cb7.gif)

### Postman

In addition to the docs site, you can also import the postman json files into
[postman](https://www.getpostman.com/) to test making real API calls and see the json output.

Postman files:
- [environment](https://raw.githubusercontent.com/discourse/discourse_api_docs/master/postman/discourse_local.postman_environment.json)
- [collection](https://raw.githubusercontent.com/discourse/discourse_api_docs/master/postman/discourse.postman_collection.json)

Start by importing the environment json file. After you import it be sure to
change the `base_url`, `api_username`, and `api_key` values to match your
discourse instance.

Now you can import the collection json file and start making API requests.

Here is a demo:

![discourse_postman](https://cloud.githubusercontent.com/assets/1490496/20265862/9478355a-aa30-11e6-98b0-ecf7d2ab9263.gif)

### Contributing

Contributions are welcome! Start by cloning the repo.

To edit the api docs, edit the swagger.yml file not the json file.
To edit the api docs, edit the openapi.yml file not the json file.

To view your changes locally, run:

Expand Down
1 change: 0 additions & 1 deletion definitions/admin/generate_api_key.yml
@@ -1,4 +1,3 @@
$schema: 'http://json-schema.org/draft-04/schema#'
description: ""
type: object
properties:
Expand Down
3 changes: 1 addition & 2 deletions definitions/admin/get_badges.yml
@@ -1,4 +1,3 @@
$schema: 'http://json-schema.org/draft-04/schema#'
description: ""
type: object
properties:
Expand Down Expand Up @@ -43,7 +42,7 @@ properties:
auto_revoke:
type: boolean
show_posts:
type: booelan
type: boolean
badge_type_id:
type: number
badge_types:
Expand Down
1 change: 0 additions & 1 deletion definitions/admin/get_user.yml
@@ -1,4 +1,3 @@
$schema: 'http://json-schema.org/draft-04/schema#'
description: ""
type: object
properties:
Expand Down
1 change: 0 additions & 1 deletion definitions/admin/site_settings.yml
@@ -1,4 +1,3 @@
$schema: 'http://json-schema.org/draft-04/schema#'
description: ""
type: object
properties:
Expand Down
1 change: 0 additions & 1 deletion definitions/categories/update_category_response.yml
@@ -1,4 +1,3 @@
$schema: 'http://json-schema.org/draft-04/schema#'
description: ""
type: object
properties:
Expand Down
1 change: 0 additions & 1 deletion definitions/groups/get_group_response.yml
@@ -1,5 +1,4 @@
type: object
$schema: 'http://json-schema.org/draft-04/schema#'
description: ""
properties:
group:
Expand Down
1 change: 0 additions & 1 deletion definitions/groups/get_groups_response.yml
@@ -1,5 +1,4 @@
type: array
$schema: 'http://json-schema.org/draft-04/schema#'
description: ""
minItems: 1
uniqueItems: true
Expand Down
1 change: 0 additions & 1 deletion definitions/groups/group_members_response.yml
@@ -1,4 +1,3 @@
$schema: 'http://json-schema.org/draft-04/schema#'
description: ""
type: object
properties:
Expand Down
1 change: 0 additions & 1 deletion definitions/groups/new_group_response.yml
@@ -1,4 +1,3 @@
$schema: 'http://json-schema.org/draft-04/schema#'
description: ""
type: object
properties:
Expand Down
1 change: 0 additions & 1 deletion definitions/notifications/get.yml
@@ -1,4 +1,3 @@
$schema: 'http://json-schema.org/draft-04/schema#'
description: ""
type: object
properties:
Expand Down
1 change: 0 additions & 1 deletion definitions/posts/get_post_response.yml
@@ -1,4 +1,3 @@
$schema: 'http://json-schema.org/draft-04/schema#'
description: ""
type: object
properties:
Expand Down
1 change: 0 additions & 1 deletion definitions/posts/get_posts_response.yml
@@ -1,4 +1,3 @@
$schema: 'http://json-schema.org/draft-04/schema#'
description: ""
type: object
properties:
Expand Down
1 change: 0 additions & 1 deletion definitions/posts/update_post_response.yml
@@ -1,4 +1,3 @@
$schema: 'http://json-schema.org/draft-04/schema#'
description: ""
type: object
properties:
Expand Down
1 change: 0 additions & 1 deletion definitions/search/query_response.yml
@@ -1,4 +1,3 @@
$schema: 'http://json-schema.org/draft-04/schema#'
description: ""
type: object
properties:
Expand Down
1 change: 0 additions & 1 deletion definitions/topics/invite.yml
@@ -1,4 +1,3 @@
$schema: 'http://json-schema.org/draft-04/schema#'
description: ""
type: object
properties:
Expand Down
1 change: 0 additions & 1 deletion definitions/topics/latest_topics_response.yml
@@ -1,4 +1,3 @@
$schema: 'http://json-schema.org/draft-04/schema#'
description: ""
type: object
properties:
Expand Down
1 change: 0 additions & 1 deletion definitions/topics/new_topic_response.yml
@@ -1,4 +1,3 @@
$schema: 'http://json-schema.org/draft-04/schema#'
description: ""
type: object
properties:
Expand Down
1 change: 0 additions & 1 deletion definitions/topics/private-messages-sent.yml
@@ -1,4 +1,3 @@
$schema: 'http://json-schema.org/draft-04/schema#'
description: ""
type: object
properties:
Expand Down
1 change: 0 additions & 1 deletion definitions/topics/private-messages.yml
@@ -1,4 +1,3 @@
$schema: 'http://json-schema.org/draft-04/schema#'
description: ""
type: object
properties:
Expand Down
1 change: 0 additions & 1 deletion definitions/topics/top.yml
@@ -1,4 +1,3 @@
$schema: 'http://json-schema.org/draft-04/schema#'
description: ""
type: object
properties:
Expand Down
1 change: 0 additions & 1 deletion definitions/topics/update_topic_response.yml
@@ -1,4 +1,3 @@
$schema: 'http://json-schema.org/draft-04/schema#'
description: ""
type: object
properties:
Expand Down
1 change: 0 additions & 1 deletion definitions/users/directory_items_response.yml
@@ -1,4 +1,3 @@
$schema: 'http://json-schema.org/draft-04/schema#'
description: ""
type: object
properties:
Expand Down
1 change: 0 additions & 1 deletion definitions/users/get_user_response.yml
@@ -1,4 +1,3 @@
$schema: 'http://json-schema.org/draft-04/schema#'
description: ""
type: object
properties:
Expand Down
1 change: 0 additions & 1 deletion definitions/users/list.yml
@@ -1,5 +1,4 @@
type: array
$schema: 'http://json-schema.org/draft-04/schema#'
description: ""
minItems: 1
uniqueItems: true
Expand Down
1 change: 0 additions & 1 deletion definitions/users/new_user_response.yml
@@ -1,4 +1,3 @@
$schema: 'http://json-schema.org/draft-04/schema#'
description: ""
type: object
properties:
Expand Down
2 changes: 1 addition & 1 deletion index.html
Expand Up @@ -20,7 +20,7 @@
</style>
</head>
<body>
<redoc spec-url='https://docs.discourse.org/swagger.json' lazy-rendering></redoc>
<redoc spec-url='https://docs.discourse.org/openapi.json' lazy-rendering></redoc>
<script src="https://cdn.jsdelivr.net/npm/redoc/bundles/redoc.standalone.js"> </script>
</body>
</html>
2 changes: 1 addition & 1 deletion local.html
Expand Up @@ -20,7 +20,7 @@
</style>
</head>
<body>
<redoc spec-url='/swaggerfile' lazy-rendering></redoc>
<redoc spec-url='/openapifile' lazy-rendering></redoc>
<script src="https://cdn.jsdelivr.net/npm/redoc/bundles/redoc.standalone.js"> </script>
</body>
</html>

0 comments on commit 9d688aa

Please sign in to comment.