Skip to content

Add first iteration of parameter handling for OAPI

What does this MR do and why?

  • Adds the first, incomplete, pass at handling parameters in Grape -> OpenAPI conversion.
  • Doesn't handle POST body params yet as well as a handful of edge cases.

I've opened this MR now, since it works and there will be more MRs to follow to complete #572542, but didn't want this one to get any larger.

How to set up and validate locally

  • In a rails console, run the following:
api_classes = API::Base.descendants
entity_classes = Grape::Entity.descendants
generator = Gitlab::GrapeOpenapi::Generator.new(api_classes: api_classes, entity_classes: entity_classes)
File.write(Rails.root.join('tmp', 'myfile.json'), generator.generate.to_json)
  • Download the redocly cli tool, and generate a static API doc site using redocly build-docs path/to/json/file.json

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #572542

Edited by Max Woolf

Merge request reports

Loading