Design and Build Great Web APIs by Mike Amundsen
Author:Mike Amundsen
Language: eng
Format: epub, pdf
Tags: Pragmatic Bookshelf
Publisher: The Pragmatic Bookshelf, LLC
If you scroll up a bit, youâll also notice that the editor UI displays a box showing a curl command-line example that calls the same endpoint. That should look something like this:
â curl -X GET
â "https://virtserver.swaggerhub.com/mamund/onboarding-master/1.0.0/"
â -H "accept: application/prag+json"
â -H "ETag: zaxscdvfbg"
When you execute that at the command line, youâll get a response similar to the one shown in the UI screenshot shown earlier.
You can also test out write operations using the SwaggerHub mock service. It wonât really write any data to a server, but it will âmockâ all the steps, including making sure you supply the proper arguments. A curl-ed version of the updateCompanyData action looks like this:
â curl -X PUT
â "https://virtserver.swaggerhub.com/.../1.0.0/wip/q1w2e3r4/company"
â -H "accept: application/prag+json"
â -H "If-Match: zaxscdvfbg"
â -H "Content-Type: application/x-www-form-urlencoded"
â -d "identifier=q1w2e3r4&companyName=SmithCo"
Note that, for the purposes of display in this book, I shortened the URL line (...) to make sure it fit on the page. Youâll also notice that the responses for all these tests are the same. The mock server just responds with the #/components/reply response defined within the OAS file.
Now that you know you can test the API using both the SwaggerHub editor interface and tools like curl, you have a working prototype you can use to test your ideas, show to others, andâwhen neededâmodify the prototype to fix bugs and improve the interface in order to get it all set for the final work of the actual code-based implementation.
Before I wrap up this chapter, I want to cover one more thing you can do with OAS files: generate basic documentation for your API.
Download
Design and Build Great Web APIs by Mike Amundsen.pdf
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Hello! Python by Anthony Briggs(9926)
The Mikado Method by Ola Ellnestam Daniel Brolund(9786)
Dependency Injection in .NET by Mark Seemann(9348)
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(7789)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(7566)
Svelte with Test-Driven Development by Daniel Irvine(7245)
Test-Driven Development with PHP 8 by Rainier Sarabia(6980)
Layered Design for Ruby on Rails Applications by Dementyev Vladimir;(6840)
Secrets of the JavaScript Ninja by John Resig & Bear Bibeault(6541)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(6423)
Web Development with Django by Ben Shaw Saurabh Badhwar(6304)
React Application Architecture for Production by Alan Alickovic(6025)
Jquery UI in Action : Master the concepts Of Jquery UI: A Step By Step Approach by ANMOL GOYAL(5813)
Kotlin in Action by Dmitry Jemerov(5073)
Audition by Ryu Murakami(4592)
Software Architecture for Web Developers by Mihaela Roxana Ghidersa(4494)
Accelerating Server-Side Development with Fastify by Manuel Spigolon Maksim Sinik & Matteo Collina(4345)
Hands-On Full-Stack Web Development with GraphQL and React by Sebastian Grebe(4323)
Solidity Programming Essentials by Ritesh Modi(4050)
