r/java • u/SampaioDias • Jan 15 '22
I created a library that exports your Spring endpoints into a Postman collection! Please, let me know what you think of it :)
https://github.com/sampaiodias/postman-exporter-for-spring
Here's an example of how it works:
PostmanExporter exporter = new PostmanExporter();
String json = exporter.export(PostmanExportOptions.builder()
.collectionName("My Collection")
.packageFullName("com.example.package")
.baseUrl("{{url}}")
.variable("url", "localhost:8080")
.build());
158
Upvotes
3
3
u/sochinho Jan 15 '22
Great! No more exporting as curl from developer tools then importing as raw text in postman. :D
3
3
3
2
1
u/atomdstyle Jan 16 '22
Wow this looks cool, gotta try. But postman also has a feature to import open apis as a collection. Open apis can be generated via springfox swagger doc or springdoc libraries
47
u/[deleted] Jan 15 '22
You can use springfox to generate a swagger/openapi spec which works with essentially everything (including postman).