Skip to content

Edit Settings API annotation

Eugene Lim requested to merge elim-ext-settings-api-annotation into master

There is a small edge case where grape-swagger expects Hash type parameters to explicitly define its properties (via a do block), otherwise it excludes the parameter in its output. However, since the repository_storages_weighted parameter can have properties with arbitrary keys e.g. { 'custom': 80 }, we cannot define them. Instead, I added a documentation-only annotation to set the type to Object. Using additionalProperties helps to output a String-to-Integer hash map object type (https://swagger.io/docs/specification/data-models/dictionaries/) which is the exact use case here.

Merge request reports