Makes it easier to use, like resolve-refs. It just needs to be called once.
Fixes an issue with m.call.* events not displaying the common fields
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
... and other improvements
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
If an object definition already has an example, we shouldn't try to extend that
definition by adding examples derived from the individual properties. Doing so
is confusing, and there is no way to inhibit it when it is not desired. It's
also not what the RapiDoc viewere does, so we end up with examples being
inconsistent.
I forgot to set the `items` on an array definition, and got an extremely
opaque error. Hopefully this will improve the lives of anyone who makes a
similar mistake in future.
* Remove redundant call to resolve-allof
All of the callers to resolve-additional-types already call resolve-allof (or
if not, they should), so this is redundant.
* Update `resolve-additional-types` to take a dict
I want to add more params to this, so first make it take a dict.
* `render-object-table`: take a "title" rather than a "caption"
... which means we can use the result from resolve-additional-types directly.
* render-object-table: support adding an anchor to generated tables.
* resolve-additional-types: generate an id for each returned type
* render-event: pass an anchor_base into resolve-additional-types
This means that it will generate an anchor for each type, whihc will then be
passed into render-object-table and used as an `id` for the table.
* render-operation: pass an anchor_base into resolve-additional-types
* newsfiles
* Fix rendering of response examples
Fixes the autogeneration of JSON examples for array objects. This fixes a
number of "Specification error: Example invalid or not present" errors in the
rendered spec.
* Unbreak examples for non-objects/arrays
The previous change had broken auto-generated examples for everything that
wasn't an object or array; fix it up again.
* Remove conditions on $example
Everything should now have a generated example, so the condition is
redundant. Furthermore it was suppressing examples for APIs where the example
was an empty dict.