Skip to content

Fix gitlab:openapi:generate rake task

Stanislav Dobrovolschii requested to merge fix/openapi-generate into master

What does this MR do and why?

MR changes Entities::Member module references to ::API::Entities::Member class references, to fix the GrapeSwagger::Errors::UnregisteredParser (No parser registered for EE_API_Entities_Member) error when executing the gitlab:openapi:generate rake command. Error happens because of Entities::Member is getting resolved to ::EE::API::Entities::Member (in EE context) which results in Errors::UnregisteredParser raised by grape-swagger, as it expects that class to be a Grape::Entity subclass not a module.

Currently this issue is reproducible on master, but just in case here are few more of affected MRs:

How to set up and validate locally

Reproduce the error (on master branch):

  1. Run rake gitlab:openapi:generate
  2. Check the doc/api/openapi/openapi_v2.yaml - it should be message: 500 Internal Server Error
  3. Check the log/development.log - there should be UnregisteredParser traces

Validate fix (on fix/openapi-generate):

  1. Run rake gitlab:openapi:generate
  2. Check the doc/api/openapi/openapi_v2.yaml - it should be a valid yml file with Open API spec
  3. Check the log/development.log - there should be no Open API related errors

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Stanislav Dobrovolschii

Merge request reports