A scala DSL to generate JSON schema and swagger documentation for your web services.
This release improves library support of the swagger spec and corrects the serialisation of Scala options into Json schema definitions.
Contributed by Alvaro Delgado @algd
We have reworked the types modelling security schemes and implemented JSON serialisation for them. Through our own internal use of the library, we have also verified that the basic security scheme is now handled correctly by swagger UI.
The implementation of JsonSchema[Option[A]]
has been amended so that:
A
is a primitive. Otherwise, a reference to A's definition is renderedscala.Option
JSON codecs were previously kept in the com.timeout.docless.encoders
package, which the end-user to import them explicitly. We have now moved them into the swagger.ApiSchema
companion object, thus the import is not needed anymore.
So far, the validations performed as part of the PathGroup.aggregate
were only checking for top-level definitions. This PR introduces a new schema error (MissingDefinition) aimed at covering cases where nested field definitions are omitted. In order to make this possible, JsonSchema.Definition
has been refactored into a sealed trait, allowing for both named definitions (for case class fields) and unnamed ones (for coproducts).