This commit basically makes it where you can pass in a list of custom
formats when creating the `SwaggerApi` object and/or you can call
`SwaggerApi#registerFormat(name, validator)`. This just proxies through
to `ZSchema#registerFormat(name, validator)` so any value that is
permitted there is permitted here.
This is the bare minimum as there are no features around getting a list
of known formats, being warned if you are re-registering a format, etc.
But since those features were not asked for, this should do what is
required.
Fixes#74
We've always normalized JSON Schema errors provided by z-schema but this
is unnecessary and in some cases not wanted. This change will no longer
remove the `params` property of a validation error and will only remove
the `schemaId` property if its value is `undefined`.
Fixes#61
* All type objects' `definition` property is now the original definition
and is no longer the fully resolved definition
* All type objects now have a `definitionFullyResolved` that is the
fully resolved definition *(Previously the `definition` property)
* We no longer overwrite `Operation.parameters` with the composite view
of operation parameters
* We no longer overwrite `Operation.security` with the composite view of
operation security *(This is now available as the
`Operation#getSecurity` API)*
Update `Operation#validateResponse` and `Response#validateResponse`
consistent with `Operation#validateRequest` and
`Response#validateRequest` respectively by wrapping all arguments in an
object so we can change things without breaking the API.
Fixes#52
JSON Schema allows its schemas to omit the type property but Sway was
treating missing types as objects. Not only is this wrong but it also
led to bugs like #46.
These APIs were removed in favor of `SwaggerApi#validate` returning the
validation results. Not only is this API simpler but for the newly
created `Operation#validateRequest` and `Operation#validateResposne`,
these changes will result in a consistent approach for all validation APIs.
We will address localization as a whole at a later time but until then,
it does not make sense to have a binary that is huge just to somewhat
support localization.
* Parameter#getValue takes an http.CientRequest (or similar) and returns
a wrapper object containing the raw value, the processed value and any
errors that occured during processing.