Forum Discussion

mikhailasadchy's avatar
mikhailasadchy
Occasional Visitor
6 years ago

Swagger in junit

From the swagger UI (https://petstore.swagger.io/?_ga=2.138463798.444042846.1559674010-1100161644.1559674010#/pet/addPet) I can make a call in introduced format by clicking "Try it out" button. It is great! But, is there a possibility to:

- use swagger to generate http request objects in java in introduced format. For instance, I want make this call (https://petstore.swagger.io/?_ga=2.138463798.444042846.1559674010-1100161644.1559674010#/pet/findPetsByStatus) from the java test, providing a parametr status as an argument to some method, which will generate httpRequest or make a call and return httpResponse. 

  • We don't provide a way to do that out of the box, but you can create your own Swagger Codegen generator that will generate the code for you.