
Remove Examples from Swagger for API Gateway
Introduction I developed an npm library to remove example entries from Swagger files. It is publicly available at the following: npm | swagger-rm-example GitHub | swagger-rm-example Functionality Suppose you have a Swagger file with example entries like this: swagger : ' 2.0' info : description : This is an API for apartment information. version : 0.0.1 title : Apartment API paths : ' /rooms/{room-id}' : get : summary : Room Information API description : Returns information for the specified room-id parameters : - name : room-id in : path description : The ID of the room you want to retrieve required : true type : integer format : int64 responses : ' 200' : description : OK schema : type : object properties : id : type : integer format : int64 example : 404 comment : type : string example : Room 404. It may not exist anywhere. When you input the above, the output will be as follows: swagger : ' 2.0' info : description : This is an API for apartment information. version : 0.0.1 title :
Continue reading on Dev.to JavaScript
Opens in a new tab

