# `AshJsonApi.OpenApi`
[🔗](https://github.com/ash-project/ash_json_api/blob/v1.6.5/lib/ash_json_api/json_schema/open_api.ex#L6)

Provides functions for generating schemas and operations for OpenApi definitions.

Add `open_api_spex` to your `mix.exs` deps for the required struct definitions.

## Example

    defmodule MyApp.OpenApi do
      alias OpenApiSpex.{OpenApi, Info, Server, Components}

      def spec do
        %OpenApi{
          info: %Info{
            title: "MyApp JSON API",
            version: "1.1"
          },
          servers: [
            Server.from_endpoint(MyAppWeb.Endpoint)
          ],
          paths: AshJsonApi.OpenApi.paths(MyApp.Api),
          tags: AshJsonApi.OpenApi.tags(MyApp.Api),
          components: %Components{
            responses: AshJsonApi.OpenApi.responses(),
            schemas: AshJsonApi.OpenApi.schemas(MyApp.Api)
          }
        }
      end
    end

# `define_filter?`

# `empty_acc`

Creates an empty accumulator for schema generation.

# `paths`

```elixir
@spec paths(
  domain :: module() | [module()],
  module() | [module()],
  opts :: Keyword.t(),
  acc :: acc()
) ::
  {OpenApiSpex.Paths.t(), acc()}
```

Paths (routes) from the domain.

# `raw_filter_type`

# `resource_filter_fields_fields_only`

# `responses`

```elixir
@spec responses() :: OpenApiSpex.Components.responses_map()
```

Common responses to include in the API Spec.

# `schemas`

# `schemas`

```elixir
@spec schemas(domain :: module() | [module()], acc :: acc()) :: %{
  required(String.t()) =&gt; OpenApiSpex.Schema.t()
}
```

Resource schemas to include in the API spec.

# `spec`

# `tags`

```elixir
@spec tags(domain :: module() | [module()]) :: [OpenApiSpex.Tag.t()]
```

Tags based on resource names to include in the API spec

# `tags`

# `write_attributes`

```elixir
@spec write_attributes(
  resource :: module(),
  [Ash.Resource.Actions.Argument.t()],
  action :: term(),
  route :: term(),
  acc :: acc(),
  format :: content_type_format()
) :: {%{required(atom()) =&gt; OpenApiSpex.Schema.t()}, acc()}
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
