# `WardrikRest.Discovery.Schema`

Turns Discovery schemas into JSON Schema types for `WardrikRest.Spec`.

A reference to another schema stays a reference, as `%{"$ref" => "Campaign"}`, by the schema's
short name: a prefix ending in `__`, as Google Ads' `GoogleAdsGoogleadsV24Resources__`, is
dropped where the rest is still unique. Fields the API only returns are left out, and so are
the `UNSPECIFIED` and `UNKNOWN` values Google gives its enums, which no request may send.

# `fields`

```elixir
@spec fields(map(), map(), map()) :: [{String.t(), map()}]
```

Returns the fields of the request body `request` refers to, each with its JSON Schema, leaving
out fields the API only returns. `names` are the schemas' short names.

# `names`

```elixir
@spec names(map()) :: %{required(String.t()) =&gt; String.t()}
```

Returns the short name of each schema of `schemas`, by its name in the document.

# `parameter`

```elixir
@spec parameter(map()) :: map()
```

Returns the JSON Schema of a method's parameter, with its description.

# `types`

```elixir
@spec types(map()) :: %{required(String.t()) =&gt; map()}
```

Returns every schema of `schemas` as a JSON Schema type, by its short name.

---

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