Fix gitlab:openapi:generate rake task
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):
- Run
rake gitlab:openapi:generate
- Check the
doc/api/openapi/openapi_v2.yaml
- it should bemessage: 500 Internal Server Error
- Check the
log/development.log
- there should beUnregisteredParser
traces
Validate fix (on fix/openapi-generate
):
- Run
rake gitlab:openapi:generate
- Check the
doc/api/openapi/openapi_v2.yaml
- it should be a valid yml file with Open API spec - 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.
-
I have evaluated the MR acceptance checklist for this MR.