docs(other): respect usage article#149
Conversation
12e7702 to
9f2c0e4
Compare
| <b>IMPORTANT: the API description intentionally contains discrepancies for demonstration purposes.</b> | ||
|
|
||
| ```yaml | ||
| openapi: 3.1.0 |
There was a problem hiding this comment.
Using the 3.1.0 example, as VSCE currently doesn’t support rendering 3.2.0 and we would like to allow users to have valid preview.
| - page: ./linting-arazzo-workflows.md | ||
| - page: ./testing-arazzo-workflows.md | ||
| - page: ./documenting-multiple-apis-using-arazzo.md | ||
| - group: Respect practical example series |
There was a problem hiding this comment.
Is it ok to keep it as learn/arazzo articles or should we transform them into blog posts?
|
|
||
| Arazzo provides a standard way to describe API workflows declaratively. Respect uses those workflows to run API contract tests against real API behavior. | ||
|
|
||
| With this approach, teams can maintain API test coverage, detect documentation drift earlier, and share executable API workflows across engineering, QA, and documentation teams. No newline at end of file |
There was a problem hiding this comment.
Do we want to put a link to the next part of this tutorial somewhere here?
There was a problem hiding this comment.
cc: @Redocly/technical-writers
| - The status code and content type checks pass because the response matches the documented response metadata. | ||
| - The schema check fails because the response body shape does not match the documented schema. | ||
|
|
||
| <details> |
There was a problem hiding this comment.
@Redocly/technical-writers is it better to use terminal output screenshot here?
| This article shows how to use Respect, powered by Arazzo workflows, for API contract testing. | ||
| You will learn how to describe an API workflow, execute it with Redocly CLI, and use the results to find mismatches between an OpenAPI description and the real API behavior. | ||
|
|
||
| You will cover the following topics: | ||
|
|
||
| Practical applications of Arazzo: | ||
|
|
||
| - Automating repetitive API workflows. | ||
| - Adding API contract tests to CI/CD routines. | ||
| - Keeping API documentation synchronized with actual API behavior. | ||
| - Sharing described workflows across teams. | ||
| - Using the open-source [@redocly/cli](https://www.npmjs.com/package/@redocly/cli) `respect` command to execute Arazzo workflows, inspect contract test results, and fix mismatches between the OpenAPI description and the actual API response. |
There was a problem hiding this comment.
| This article shows how to use Respect, powered by Arazzo workflows, for API contract testing. | |
| You will learn how to describe an API workflow, execute it with Redocly CLI, and use the results to find mismatches between an OpenAPI description and the real API behavior. | |
| You will cover the following topics: | |
| Practical applications of Arazzo: | |
| - Automating repetitive API workflows. | |
| - Adding API contract tests to CI/CD routines. | |
| - Keeping API documentation synchronized with actual API behavior. | |
| - Sharing described workflows across teams. | |
| - Using the open-source [@redocly/cli](https://www.npmjs.com/package/@redocly/cli) `respect` command to execute Arazzo workflows, inspect contract test results, and fix mismatches between the OpenAPI description and the actual API response. | |
| This article shows how to use Respect, powered by Arazzo workflows, for API contract testing. | |
| You will cover the following topics: | |
| - Automating repetitive API workflows. | |
| - Adding API contract tests to CI/CD routines. | |
| - Keeping API documentation synchronized with actual API behavior. | |
| - Sharing described workflows across teams. | |
| - Using the open-source Redocly CLI to execute Arazzo workflows, inspect contract test results, and fix mismatches between the OpenAPI description and the actual API response. |
BTW, This is a lot of topics. Maybe split them into two articles?
There was a problem hiding this comment.
All of those needed to cover flow with Auth, but we can make smaller about reusable Arazzo.
| Every Arazzo file begins with a version declaration. | ||
| The latest stable version is `1.0.1`. |
There was a problem hiding this comment.
This is definitely redundant if you have basic familiarity with Arazzo. Either remove this or do add a separate guide on creating the Arazzo description itself.
There was a problem hiding this comment.
I removed some, but maybe we can keep at least pointers started from workflow level?
|
|
||
| </details> | ||
|
|
||
| In addition to the success criterion declared in the Arazzo file, Respect performed three additional checks automatically: |
There was a problem hiding this comment.
You've already said this here: https://github.com/Redocly/website/pull/149/changes#diff-90b9281218ab219b15a4758675d34ce45fe04dfde843f556a82dd8ade246a351R140. Please avoid repeating yourself.
There was a problem hiding this comment.
Its more detailed description compare to
Respect also runs additional automatic checks based on the connected OpenAPI description (see the next section).
| npm install @redocly/cli@latest -g | ||
| redocly respect products.arazzo.yaml --verbose |
There was a problem hiding this comment.
Let's not confuse readers with different running options. Let's use the npx ... way everywhere.
There was a problem hiding this comment.
And that could be put into the Summary section anyway.
There was a problem hiding this comment.
Lets keep the Summary small.
| After the schema is updated, the response body matches the documented contract. | ||
| This demonstrates the core value of contract testing with Respect: when the API and its OpenAPI description drift apart, the workflow highlights the mismatch immediately. | ||
|
|
||
| ## Practical applications |
There was a problem hiding this comment.
I'm not even sure we have to explain practical cases in this article. I'd restrict that to saying that from now on it could be used in a CI/CD pipeline to check if there's no divergency between the docs and the server.
There was a problem hiding this comment.
cc: @Redocly/technical-writers
dc03d73 to
238d21b
Compare
There was a problem hiding this comment.
marketing-site AI Review: 🟢 Completed
Reunite Bot has reviewed your changes and found 6 potential issue(s).
Note
Low Risk
This PR contains only documentation updates. There are no changes to the application code, ensuring there is no impact on runtime behavior or system stability.
Overview
Adds the first two articles for the "Respect practical example series" using Code Walkthroughs:
- API Contract Testing: Demonstrates how to automate testing and verify API behavior using Arazzo workflows.
- OAuth2 Authorization: Explains how to test OAuth2-secured API endpoints, focusing on reusable workflows and passing values between them.
Additionally, this PR adds the required _filesets (Arazzo and OpenAPI YAML specifications for the Redocly Cafe API) and updates learn/arazzo/sidebars.yaml to include the new guides in the navigation.
| The second step, `authorize-with-client_credentials`, calls `/oauth2/token` using the credentials returned by the previous step. | ||
|
|
||
| In a production application, the `/callback` URL is usually implemented by the client application. | ||
| In this example, the Redocly Cafe API provides the callback endpoint for demonstration purposes. |
There was a problem hiding this comment.
The comment about the /callback URL is misleading for the Client Credentials grant, as this flow is machine-to-machine and does not utilize a callback mechanism. This belongs to the Authorization Code grant.
|
|
||
| To follow the examples in this article, you need: | ||
|
|
||
| - Basic familiarity with [Arazzo](https://redocly.com/learn/arazzo/what-is-arazzo). |
There was a problem hiding this comment.
Use a relative link ../what-is-arazzo.md instead of the absolute URL https://redocly.com/learn/arazzo/what-is-arazzo to ensure the link works correctly in local preview and self-hosted environments.
What/Why/How?
Added two first articles related to practical usage of the Respect command, using Code Walkthrough.
The idea is to provide a set of ready-to-use articles/templates connected to the Redocly Cafe API, allowing users to easily explore how it works and adopt them for similar use cases.
Reference
Testing
Screenshots (optional)
Check yourself
Security