I gave a talk at the Silicon Valley Perl Meetup on “REST API Server Programming With Perl.”
Here are the slides:
- Part 1: “The REST API Landscape in 2017”
- Part 2: “REST API Server Programming with Perl, Swagger and the Mojolicious Framework”
There was an extended audience discussion afterwards with some interesting observations:
- “If you use boolean; before use JSON;, you may get the true/false behavior you want.”
- “Catalyst fixed their module dependencies issues a few years ago and can be installed quickly now.”
- “Even though Swagger2 provides some input parameter validation, all the 3-letter security acronyms have to be handled.”
- “Upgrading our spec file from Swagger 1.0 to Swagger 2.0 didn’t work until we added a directive like ‘x-mojo-controller2’.”
- “Consider just validating a part of the spec when doing input validation of requests.”
Swagger 2.0: How to specify an input parameter of type ‘object’?
Reading the Swagger 2.0 spec:
- body location supports input objects now. path and query locations request input arrays for now, and objects later (limited by not having Content-type per input parameter).
- output response can be objects.
- having said that, whether your validator supports that or not requires testing.
“The Swagger representation of the API is made of a single file. However, parts of the definitions can be split into separate files, at the discretion of the user. This is applicable for $ref fields in the specification as follows from the JSON Schema definitions.
By convention, the Swagger specification file is named swagger.json.”
Thanks to Nvidia for hosting the meetup again.
OpenAPI Specification Version 2.0
URLs are UI
Jeremy Zawodny: From mod_perl to Mojolicious at craigslist Slides
amihaiemil.com: What is HATEOAS?
Ask HN: What’s your biggest struggle with Microservices?
Ask HN: What are the not-so obvious things to consider while API integration?
Ask HN: In 2018, What makes a good API?