#!/usr/bin/env sh # Generate the API documentation based on our specs. # # The standard way to generate the documentation is `rake rswag` which calls # rspec under the hood. We have a few customisations to the rspec call though # which only work when calling rspec ourselves. # # - We actually run the specs to generate examples instead of a dry run. # While rswag has an RSWAG_DRY_RUN switch, it doesn't work with our setup. # - We add relevant engines to the pattern. # - We run only tagged swagger specs instead of all matching the pattern. exec ./bin/rspec\ --pattern "spec/requests/api/**/*_spec.rb,engines/dfc_provider/spec/requests/**/*_spec.rb"\ --tag "swagger_doc"\ --format "Rswag::Specs::SwaggerFormatter"\ --order "defined"