Skip to content

Commit

Permalink
Merge pull request #285 from open-api-spex/version-3.9.0
Browse files Browse the repository at this point in the history
Version 3.9.0
  • Loading branch information
moxley authored Sep 15, 2020
2 parents 2fc3c6b + bc70c71 commit 06f38fb
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 9 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
# 3.9.0

Thanks to the contributions of the community ❤️💙💛💜🧡

- [feng19](https://github.com/feng19)
- [jbernardo95](https://github.com/jbernardo95)

- Feature: Generate example from schema (#266)
- Feature: Allow SwaggerUI to be configured via Plug opts (#271)
- Feature: Warn on invalid or missing operation specs (#273, #278)
- Feature: Experimental alternative API for defining Operation specs (#265, #280)
- Fix: Handle the same operation occurring at different routes (#272)
- Fix: Casting header names that have upper-case letters in specs (#281)
- Maint: Upgrade Elixir dependencies in example projects (#269)
- Maint: Format project with Elixir Formatter (#279)

# 3.8.0

Thanks to the contributions of the community ❤️💙💛💜🧡
Expand Down
14 changes: 7 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
If you've found a bug or would like to discuss a new feature, start by [opening an issue](https://github.com/open-api-spex/open_api_spex/issues/new).
Where possible, please refer to the relevant sections of the Open API Specification 3.0 or JSON Schema Specification:

* https://swagger.io/docs/specification/
* https://github.com/OAI/OpenAPI-Specification/blob/OpenAPI.next/versions/3.0.0.md
* https://json-schema.org/understanding-json-schema/

- https://swagger.io/docs/specification/
- https://github.com/OAI/OpenAPI-Specification/blob/OpenAPI.next/versions/3.0.0.md
- https://json-schema.org/understanding-json-schema/

## Send a Pull Request

Expand All @@ -19,9 +18,9 @@ Please be patient as maintainers are generally volunteering their time to suppor

You can ask for help using OpenApiSpex by:

* [Opening an issue](https://github.com/open-api-spex/open_api_spex/issues/new) - you may have run in to a bug or poorly documented feature!
* Using the [open_api_spex slack channel](https://elixir-lang.slack.com/messages/CPEN5UW1X)
* Using the [Elixir Forum thread](https://elixirforum.com/t/openapispex-openapi-swagger-3-0-for-plug-apis/15614)
- [Opening an issue](https://github.com/open-api-spex/open_api_spex/issues/new) - you may have run in to a bug or poorly documented feature!
- Using the [open_api_spex slack channel](https://elixir-lang.slack.com/messages/CPEN5UW1X)
- Using the [Elixir Forum thread](https://elixirforum.com/t/openapispex-openapi-swagger-3-0-for-plug-apis/15614)

## Releasing (Maintainers Only)

Expand All @@ -37,3 +36,4 @@ To ship a release to Hex.pm, complete the following checklist:
- Push master branch to `open_api_spex` repo
- Push package to Hex: `mix hex.publish`
- Add a release announcement to the [Elixir Forum thread](https://elixirforum.com/t/openapispex-openapi-swagger-3-0-for-plug-apis/15614)
- Add a release announcement to the #open_api_spex channel in the Elixir Slack workspace.
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The package can be installed by adding `open_api_spex` to your list of dependenc
```elixir
def deps do
[
{:open_api_spex, "~> 3.8"}
{:open_api_spex, "~> 3.9"}
]
end
```
Expand Down Expand Up @@ -460,6 +460,26 @@ defmodule MyErrorRendererPlug do
end
```

## Generate Examples

OpenApiSpex can generate example data from specs. This has a similar result as
SwaggerUI when it generates example requests or responses for an endpoint.
Generated examples are a convenient way to come up with test data for
controller/plug tests.

```elixir
use MyAppWeb.ConnCase

test "create/2", %{conn: conn} do
request_body = OpenApiSpex.Schema.example(MyAppWeb.Schemas.UserRequest.schema())

json =
conn
|> post(user_path(conn), request_body)
|> json_response(200)
end
```

## Validate Examples

As schemas evolve, you may want to confirm that the examples given match the schemas.
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule OpenApiSpex.Mixfile do
use Mix.Project

@version "3.8.0"
@version "3.9.0"

def project do
[
Expand Down

0 comments on commit 06f38fb

Please sign in to comment.