0

I am generating swagger.json using go-swagger with command swagger generate spec -o swagger.json

I need to set additionalProperties as false in the swagger doc to make sure user can't supply additional properties other than defined in schema/struct.

I have tried below four combinations but none of these seem to work as desired.

    // swagger:route POST /api/config/configuration configureConfig
    //
    // Configure the audit feature
    //
    // additionalProperties: false
    // AdditionalProperties: false
    // additionalParameters: false
    // AdditionalParameters: false

A(a)dditionalProperties is added as description and A(a)dditionalParameters is ignored.

Is there any other tag/meta that can be used to add the flag in swagger doc? I am not able to find it in official documentation

codingenious
  • 8,385
  • 12
  • 60
  • 90

0 Answers0