console tool for generating pdf documents out of swagger.json
file
- Generate pdf from
swagger.json
- Include company logo on first page
- Include custom page created with .md right after welcome page
- Override
swagger.json
author name - Filter endpoints which needs to be printed to pdf doc (wildcards supported)
I would like to say thank you to:
- Authors & contributors of iText7 for that amazingly easy to use pdf library
- Authors & contruibutors of CommandLineParser for awesome piece of code for parsing command line parameters like a boss.
- Authors & contributors of CommonMark.NET for providing such easy way to parse .md files.
I had to separate somehow HTTP verb from path (but could not use space) so tool has some special small markup designed only for this purpose. Verb is separated from path by ':' (colon). For filtering sake, following combinations are allowed:
GET:/pet
- only endpoint with that specific verb and path is taken under consideration/pet
- all endpoints matching this path regardless verb are taken under considerationPOST:/*
- all endpoints matching this verb regardless path are taken under considerationPOST:/p*t
- all endpoints with verb POST and path starting with 'p' and ending with 't' are taken under consideration. Wildcards are supported only at path section of URL address.
Swagger2Pdf.exe --help
Swagger2Pdf.exe --input https://petstore.swagger.io/v2/swagger.json --output ./petstore.pdf
Swagger2Pdf.exe --input ./swagger.json --output ./petstore.pdf
Swagger2Pdf.exe --input https://petstore.swagger.io/v2/swagger.json --output ./petstore.pdf --picture ./image.png
Swagger2Pdf.exe --input https://petstore.swagger.io/v2/swagger.json --output ./petstore.pdf --picture ./image.png --custom-page ./page.md
Swagger2Pdf.exe --filter :/pet GET:/store/inventory --input https://petstore.swagger.io/v2/swagger.json --output ./petstore.pdf
Swagger2Pdf.exe --filter GET:/pet* /store/* --input https://petstore.swagger.io/v2/swagger.json --output ./petstore.pdf