Skip to content

Build paths and operations for OpenAPI

What does this MR do and why?

Implements OpenAPI 3.1 path and operation handling for internal GitLab Grape OpenAPI gem. This adds the core functionality to transform Grape API routes into OpenAPI 3.1 path items and operations with metadata extraction.

References

How to set up and validate locally

  1. Set API classes to convert
    api_classes = [API::Issues]
    # Alternatively, apply any filter logic: api_classes = API::Base.descendants.select { |k| !k.name.include?('::Internal::') }
  2. Run generator:
    generator = Gitlab::GrapeOpenapi::Generator.new(api_classes)
    spec = generator.generate
  3. Verify paths:
    spec[:paths].keys
  4. Verify operations:
    spec[:paths].values

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.

Merge request reports

Loading