diff --git a/.postman/api b/.postman/api new file mode 100644 index 00000000..e922ad54 --- /dev/null +++ b/.postman/api @@ -0,0 +1,16 @@ +id = b7086012-ff41-4be5-b6b8-70d52bf02290 + +[relations] + +[relations.collections] +rootDirectory = postman/collections + +[relations.collections.metaData] + +[relations.apiDefinition] +rootDirectory = postman/schemas +files[] = {"path":"index.yaml","metaData":{}} +files[] = {"path":"schema.yaml","metaData":{}} + +[relations.apiDefinition.metaData] +type = openapi:3 diff --git a/README.md b/README.md index 1347e29e..ea56857c 100644 --- a/README.md +++ b/README.md @@ -7,3 +7,7 @@ The objective of this work to provide living blueprints that can help introduce This project depends on the feedback of API producers and consumers to help better define each of the blueprints, as well as the elements, actions, links, and other properties they possess. With more discussion and feedback we will keep iterating on the content and artifacts available here. Using Github, Jekyll, issues, discussions, and other parts of this project to move forward how we define, discuss, and realize the API lifecycle across our organizations. **URL:** https://apis.how/ + + + +[![Run in Postman](https://run.pstmn.io/button.svg)](https://god.postman.co/run-collection/1505af7577f778db13b5?action=collection%2Fimport#?env%5BUser_mock%5D=W3sia2V5IjoiYmFzZVVybCIsInZhbHVlIjoiaHR0cHM6Ly8yNDMwMDc4Mi1iNGI2LTQxYjUtOWUyZi03MDZkM2NjOTJmMzUubW9jay5wc3Rtbi5pbyIsImVuYWJsZWQiOnRydWUsInR5cGUiOiJkZWZhdWx0Iiwic2Vzc2lvblZhbHVlIjoiaHR0cHM6Ly8yNDMwMDc4Mi1iNGI2LTQxYjUtOWUyZi03MDZkM2NjOTJmMzUubW9jay5wc3Rtbi5pbyIsInNlc3Npb25JbmRleCI6MH1d) diff --git a/_actions/discover-an-api.md b/_actions/discover-an-api.md new file mode 100644 index 00000000..d37b917d --- /dev/null +++ b/_actions/discover-an-api.md @@ -0,0 +1,30 @@ +--- +name: Discover and API +description: How to use the Private API to search and find relevant APIs. +links: + - title: Link Title + url: http://example.com + - title: Link Title + url: http://example.com + - title: Link Title + url: http://example.com +video: '' +tools: + - title: Open Source Tool + description: This is a description of this open source tool, and how it helps. + url: http://example.com + - title: Open Source Tool + description: This is a description of this open source tool, and how it helps. + url: http://example.com + - title: Open Source Tool + description: This is a description of this open source tool, and how it helps. + url: http://example.com +screenshots: + - title: Screenshot Description + url: https://postman-open-technologies.github.io/lifecycle//images/postman-screenshot.png + - title: Screenshot Description + url: https://postman-open-technologies.github.io/lifecycle//images/postman-screenshot.png + - title: Screenshot Description + url: https://postman-open-technologies.github.io/lifecycle//images/postman-screenshot.png +... +

At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.

diff --git a/_actions/document-an-api.md b/_actions/document-an-api.md new file mode 100644 index 00000000..5b5a31ae --- /dev/null +++ b/_actions/document-an-api.md @@ -0,0 +1,34 @@ +--- +name: Document an API +description: How to use markdown to describe and API. Link to the dev rel collection is relevent. +https://blog.postman.com/postman-good-documentation-checklist/ +https://blog.postman.com/the-good-collection/ +https://www.youtube.com/watch?v=cvvqJqoO7aM + +links: + - title: Link Title + url: http://example.com + - title: Link Title + url: http://example.com + - title: Link Title + url: http://example.com +video: '' +tools: + - title: Open Source Tool + description: This is a description of this open source tool, and how it helps. + url: http://example.com + - title: Open Source Tool + description: This is a description of this open source tool, and how it helps. + url: http://example.com + - title: Open Source Tool + description: This is a description of this open source tool, and how it helps. + url: http://example.com +screenshots: + - title: Screenshot Description + url: https://postman-open-technologies.github.io/lifecycle//images/postman-screenshot.png + - title: Screenshot Description + url: https://postman-open-technologies.github.io/lifecycle//images/postman-screenshot.png + - title: Screenshot Description + url: https://postman-open-technologies.github.io/lifecycle//images/postman-screenshot.png +... +

At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.

diff --git a/postman/schemas/index.yaml b/postman/schemas/index.yaml new file mode 100644 index 00000000..ab9a951d --- /dev/null +++ b/postman/schemas/index.yaml @@ -0,0 +1,358 @@ +openapi: 3.0.0 +info: + title: Users Today is Thursday this is a test + description: "API for creating and managing NOVA Security users." + version: 1.0.0 + contact: {john@test.com} + # license: + # name: test +servers: + - url: "https://3f9ab1dc-fede-484c-b519-0cc8b90c827a.mock.pstmn.io" +paths: + /create: + post: + tags: + - Create + summary: New user + description: Creates a new user in the system. The user will be assigned an ID automatically. This can be found in the response. + operationId: newUser + requestBody: + content: + application/form-urlencoded: + schema: + type: object + properties: + firstName: + type: string + example: "Constance" + lastName: + type: string + example: "Roob" + example: + firstName: "Gwendolyn" + lastName: "Bergstrom" + responses: + "200": + description: New user + headers: + Connection: + schema: + type: string + example: keep-alive + Content-Length: + schema: + type: string + example: "101" + Date: + schema: + type: string + example: "Thu, 10 Jan 2019 23:58:59 GMT" + ETag: + schema: + type: string + example: "W/\"65-KsPJ95rCxmmvvRBY2Sqroxk2vmA\"" + X-Powered-By: + schema: + type: string + example: Express + content: + application/json: + schema: + type: object + properties: + firstName: + type: string + example: Ben + id: + type: string + example: 0729d37c-ef9f-4ffa-8f71-a6eedf1f95b7 + lastName: + type: string + example: Smith + status: + type: string + example: success + examples: + New user: + value: + firstName: Ben + id: 0729d37c-ef9f-4ffa-8f71-a6eedf1f95b7 + lastName: Smith + status: success + /delete: + delete: + tags: + - Delete + summary: Delete user + description: "Deletes a user from the system by `id`." + operationId: deleteUser + parameters: + - name: id + in: query + schema: + type: string + example: "{{id}}" + description: "The user's ID" + requestBody: + content: + text/plain: + example: "" + responses: + "200": + description: Delete user + headers: + Connection: + schema: + type: string + example: keep-alive + Content-Length: + schema: + type: string + example: "64" + Date: + schema: + type: string + example: "Fri, 11 Jan 2019 00:20:55 GMT" + ETag: + schema: + type: string + example: "W/\"40-bT/ASzl0KO3wj/eo2xEBaHPLnvk\"" + X-Powered-By: + schema: + type: string + example: Express + content: + application/json: + schema: + type: object + properties: + id: + type: string + example: 0729d37c-ef9f-4ffa-8f71-a6eedf1f95b7 + status: + type: string + example: success + examples: + Delete user: + value: + id: 0729d37c-ef9f-4ffa-8f71-a6eedf1f95b7 + status: success + /get: + get: + tags: + - Read + summary: Get all users + description: Get all users in the system. + operationId: getAllUsers + parameters: + - name: all + in: query + schema: + type: string + example: "true" + responses: + "200": + description: 200 OK + headers: + Connection: + schema: + type: string + example: keep-alive + Content-Length: + schema: + type: string + example: "105" + Date: + schema: + type: string + example: "Fri, 11 Jan 2019 00:00:53 GMT" + ETag: + schema: + type: string + example: "W/\"69-ti7ujd/Cyb8EeoWoqRXh482Zy5o\"" + X-Powered-By: + schema: + type: string + example: Express + content: + application/json: + schema: + type: array + items: + type: object + properties: + firstName: + type: string + example: Ben + id: + type: string + example: 0729d37c-ef9f-4ffa-8f71-a6eedf1f95b7 + lastName: + type: string + example: Smith + status: + type: string + example: success + example: + - status: success + - firstName: Ben + id: 0729d37c-ef9f-4ffa-8f71-a6eedf1f95b7 + lastName: Smith + examples: + 200 OK: + value: + - status: success + - firstName: Ben + id: 0729d37c-ef9f-4ffa-8f71-a6eedf1f95b7 + lastName: Smith + /get/: + get: + tags: + - Read + summary: Get users by last name + description: "Retrieves all users with the given `firstName`." + operationId: getUsersByLastName + parameters: + - name: firstName + in: query + schema: + type: string + example: "Ward" + description: "The user's first name (required)" + responses: + "200": + description: "200" + headers: + Connection: + schema: + type: string + example: keep-alive + Content-Length: + schema: + type: string + example: "105" + Date: + schema: + type: string + example: "Fri, 11 Jan 2019 00:05:34 GMT" + ETag: + schema: + type: string + example: "W/\"69-F/ktIhtM5We/sndYYNUK1vmdEnQ\"" + X-Powered-By: + schema: + type: string + example: Express + content: + application/json: + schema: + type: array + items: + type: object + properties: + firstName: + type: string + example: "Favian" + id: + type: string + example: 0729d37c-ef9f-4ffa-8f71-a6eedf1f95b7 + lastName: + type: string + example: "Dibbert" + status: + type: string + example: success + example: + - status: success + - firstName: "Paula" + id: 0729d37c-ef9f-4ffa-8f71-a6eedf1f95b7 + lastName: "Purdy" + examples: + "200": + value: + - status: success + - firstName: "Kelton" + id: 0729d37c-ef9f-4ffa-8f71-a6eedf1f95b7 + lastName: "Boehm" + /update: + put: + tags: + - Update + summary: Update user + description: "Send the keys that you'd like to update, this can be one or more of `firstName`, `lastName` and `password`." + operationId: updateUser + parameters: + - name: id + in: query + schema: + type: string + example: "{{id}}" + description: "The user's ID (required)" + requestBody: + content: + application/form-urlencoded: + schema: + type: object + properties: + firstName: + type: string + example: Benjamin + password: + type: string + example: foobar + example: + firstName: Benjamin + password: foobar + responses: + "200": + description: Update user + headers: + Connection: + schema: + type: string + example: keep-alive + Content-Length: + schema: + type: string + example: "106" + Date: + schema: + type: string + example: "Fri, 11 Jan 2019 00:18:07 GMT" + ETag: + schema: + type: string + example: "W/\"6a-SA9mzR+M2pmN7WPGgLm1ZqtRYis\"" + X-Powered-By: + schema: + type: string + example: Express + content: + application/json: + schema: + type: object + properties: + firstName: + type: string + example: Benjamin + id: + type: string + example: 0729d37c-ef9f-4ffa-8f71-a6eedf1f95b7 + lastName: + type: string + example: Smith + status: + type: string + example: success + examples: + Update user: + value: + firstName: Benjamin + id: 0729d37c-ef9f-4ffa-8f71-a6eedf1f95b7 + lastName: Smith + status: success +tags: + - name: Create + - name: Read + - name: Update + - name: Delete \ No newline at end of file diff --git a/postman/schemas/schema.yaml b/postman/schemas/schema.yaml new file mode 100644 index 00000000..99ac0901 --- /dev/null +++ b/postman/schemas/schema.yaml @@ -0,0 +1,146 @@ +openapi: 3.0.0 +info: + version: v0.1.0 + title: Restaurants Hello world + description: This is the API for managing detail of the restaurants. +servers: +- url: http://api.example.com/ +paths: + "/restaurants": + get: + summary: Restaurants + operationId: getRestaurants + parameters: + - name: token + in: header + required: true + schema: + type: array + items: + type: integer + format: int64 + style: simple + tags: + - Restaurant + responses: + '200': + description: Restaurant + content: + application/json: + schema: + "$ref": "#/components/schemas/RestaurantListing" + post: + summary: Restaurant + operationId: addRestaurant + tags: + - Restaurant + requestBody: + description: Restaurant + content: + application/json: + schema: + "$ref": "#/components/schemas/Restaurant" + responses: + '201': + description: Restaurant + content: + application/json: + schema: + "$ref": "#/components/schemas/Restaurant" + "/restaurants/{restaurantId}": + get: + summary: Restaurant + operationId: getRestaurant + parameters: + - name: restaurantId + in: path + description: The unique id. + required: true + schema: + type: string + - name: newProperty + in: query + description: The unique id. + required: true + schema: + type: string + tags: + - Restaurant + responses: + '200': + description: Restaurant + content: + application/json: + schema: + "$ref": "#/components/schemas/Restaurant" + put: + summary: Restaurant + operationId: updateRestaurant + parameters: + - name: restaurantId + in: path + description: The unique id. + required: true + schema: + type: string + tags: + - Restaurant + requestBody: + description: Restaurant + content: + application/json: + schema: + "$ref": "#/components/schemas/Restaurant" + responses: + '204': + description: Restaurant + delete: + summary: Restaurant + operationId: deleteRestaurant + parameters: + - name: restaurantId + in: path + description: The unique id. + required: true + schema: + type: string + tags: + - Restaurant + responses: + '204': + description: Restaurant +components: + schemas: + RestaurantListing: + type: array + items: + "$ref": "#/components/schemas/Restaurant" + Restaurant: + type: object + properties: + id: + type: integer + format: int64 + servesCuisine: + description: The cuisine of the restaurant. + type: string + starRating: + description: An official rating for a lodging business or food establishment, + e.g. from national associations or standards bodies. Use the author property + to indicate the rating organization, e.g. as an Organization with name + such as (e.g. HOTREC, DEHOGA, WHR, or Hotelstars). + type: object + format: starRating + menu: + description: Either the actual menu as a structured representation, as text, + or a URL of the menu. + type: string + acceptsReservations: + description: Indicates whether a FoodEstablishment accepts reservations. + Values can be Boolean, an URL at which reservations can be made or (for + backwards compatibility) the strings ```Yes``` or ```No```. + type: string + hasMenu: + description: Either the actual menu as a structured representation, as text, + or a URL of the menu. + type: string