![]() Using ReDoc, speccy can offer a preview of your specifications, in human-readable format. Thanks to the -json-schema switch, you can have an OpenAPI file which $refs JSON Schema files (not just OpenAPI-flavoured JSON Schema), then resolve them all into one real OpenAPI file, thanks to wework/json-schema-to-openapi-schema. It avoid cyclical dependencies (when A has a property that $refs A, which in turn destroys your CPU), and all sorts of other things. ![]() Starting with the fantastic resolver logic form swagger2openapi, speccy has one of the most robust Pull in external $ref files to create one mega-file By default it will output to stdout, but you can pass -o with a file name to write the file locally. Resolving $ref is the art of taking multiple files and squashing them all down into one big OpenAPI file. There are strict rules which demand more contact details, "real" domains, a license, and requires tags have a description! Resolve Command There are going to be different things people are interested in, so the default rules suggest things we think everyone should do adding descriptions to parameters and operations, and having some sort of contact info. You'll see output such as: #/info R: info-contact D: info object should contain contact object v, -verbose set verbosity (use multiple times to increase level) j, -json-schema treat $ref like JSON Schema and convert to OpenAPI Schema Objects Usage: lint Įnsure specs are not just valid OpenAPI, but lint against specified rules ![]() "Bad" is subjective, but you'll see validation errors, along with special rules for making your APIs better. ![]() The goal here is to sniff your files for potentially bad things. Serve view specifications in beautiful human readable documentation Resolve pull in external $ref files to create one mega-file Lint ensure specs are not just valid OpenAPI, but lint against specified rules c, -config config file (containing JSON/YAML). ![]() Alternatively, you can use it with Docker (see "Using Docker" below.) Usage Usage: speccy ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |