-
Notifications
You must be signed in to change notification settings - Fork 160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add reference openapi mock apiproxy implementation #761
Conversation
fb899e4
to
15c3c4c
Compare
/gcbrun |
43f2f49
to
99daf81
Compare
/gcbrun |
Pipeline Report
View details in Cloud Build (permission required) Commit version: 99daf81 |
5131b95
to
c5a8065
Compare
/gcbrun |
Pipeline Report
View details in Cloud Build (permission required) Commit version: 1bc7966 |
references/openapi-mock/README.md
Outdated
|
||
Under the hood, it is using the same reference implementation JavaScript policy from this repo. | ||
|
||
Finally, you just as shown before, you would use the [Apigee CLI](https://github.com/apigee/apigeecli/releases/) to deploy the API proxy bundle. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo? "you just"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
references/openapi-mock/README.md
Outdated
The reference mock API proxy supports the following features. | ||
|
||
* [CORS](#cors) (using Apigee [CORS](https://cloud.google.com/apigee/docs/api-platform/reference/policies/cors-policy) policy) | ||
* [Request Validation](#request-validation) (using Apigee [OASValidation](https://cloud.google.com/apigee/docs/api-platform/reference/policies/oas-validation-policy)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: double space
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Went through the whole MD file and remove all instances of double spaces like this one.
references/openapi-mock/README.md
Outdated
|
||
## Customizing The Mock API Proxy | ||
|
||
This [reference implementation](./apiproxy) provides a solid foundation for building your own mock API proxy. You can customize it by adding your own policies, modifying the existing configuration, and using your own OpenAPI specification. This is a great way to learn about Apigee or to achieve more advanced customizations. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: double space
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Went through the whole MD file and remove all instances of double spaces like this one.
references/openapi-mock/README.md
Outdated
|
||
At the very minimum, you have to: | ||
|
||
1. Update the `<BasePath>/v3/petstore</BasePath>` element within the [default.xml](./apiproxy/proxies/default.xml) proxy endpoint. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: double space
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Went through the whole MD file and remove all instances of double spaces like this one.
references/openapi-mock/README.md
Outdated
**Want more control?** You can use headers to select the response Content-Type: | ||
|
||
* **Standard `Accept` header:** You can use the standard `Accept` header in your request to request a specific media type (e.g., `Accept: application/xml`). | ||
* **Random media type:** Alternatively, use the `Mock-Fuzz: true` header to have the proxy select a random media type the available ones. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the same Mock-Fuzz
header used for random status codes, content-types and response body? How does that work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, Mock-Fuzz
in general is used a hint to tell the Proxy that you want the dynamic behavior. However, it always has less precedence than the Mock-Status
and the Accept
header.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/gcbrun |
Pipeline Report
View details in Cloud Build (permission required) Commit version: 95c3737 |
/gcbrun |
Pipeline Report
View details in Cloud Build (permission required) Commit version: 69521db |
/gcbrun |
Pipeline Report
View details in Cloud Build (permission required) Commit version: 1eb0d1a |
Description
Add a reference implementation that shows how to create a feature rich mock API proxy using an OpenAPI 3 specification.
The reference implementation supports the following features:
Housekeeping
(please check all that apply [x], do not edit the text)
Full Repo Validation Required
(please check all that apply [x], do not edit the text)
CC: @apigee-devrel-reviewers