hapi-swagger/hapi-swagger

7.0.0 Release Notes

glennjones opened this issue · 1 comments

Breaking Changes

  • swaggerUI the option enableSwaggerUI has been renamed to swaggerUI
  • documentationPage the option enableDocumentation has been renamed to documentationPage
  • Swagger output has changed format, more elements will now be in the definition section of the JSON. In general this should not change the SwaggerUI rendering, but may impact people using the plugin for codegen
  • Response object automatic naming now uses the common format Model 1 etc rather than the older format response_postStore_404 - Allows for greater reuse of models and reduces library code.

New

  • Support for empty JOI objects i.e. payload: Joi.object()
  • Support for Joi.string().regex(/^[a-zA-Z0-9]{3,30}/)
  • The readme has been split into a couple of new documents Options Reference and Usage Guide

New Options

  • xProperties: Adds JOI data that cannot be use directly by swagger as metadata - default: true
  • reuseDefinitions: Reuse of definition models to save space - default: true
  • deReference: Dereferences JSON output - default: false
  • debug: Validates the JSON ouput against swagger specification and logs issues - default: false

Notes

  • Path parameters /{param} and /{param?} will have their required status set automatically, but can be overriden by Joi.required() and Joi.optionsl().
  • Path parameters /{param} and /{param?} set with as optional will be logged with warning about swagger specification validation issues.
  • x-alternatives in parameters moved to same level as schema. This is to match now other x- properties are treated in the JSON output
  • The meta property example for the response object has been renamed to examples so code response....meta({'example': JoiObj}) would become response....meta({'examples': JoiObj}) this fixes a swagger validation issue.

documentationPage the option enableDocumentation has been renamed to enableDocumentation

should be

documentationPage the option enableDocumentation has been renamed to documentationPage