Curious to know if an API proxy can be configured to return sample data for client apps so that service development and client app development can be done in parallel after spec is written and turned into Apigee api proxy.
I like the idea of relying on an OpenAPI specification document and not having to do a lot of manual configuration after the fact - to minimize the rework that will be necessary by a continually evolving OpenAPI spec.
Any solutions that would take an openAPI spec and spit out a combination of both 1) HTTP routes (nodejs/express or java, either or) and 2) implement those routes to return mock data based on the openAPI spec?
Regards
Solved! Go to Solution.
Hi @Chris D
You can do it by using:
Your Apigee proxy can point to the above mock targets while being developed. Once they are developed and deployed, just change the Target server configuration to point to the live target server. Everything should work as usual 🙂
Hope this helps !!!
Sorry about the confusion with your question drafts, etc.
To answer your question, YES, it is possible to design an API proxy endpoint in Apigee Edge that delivers "test" or mock data to callers. There are multiple ways to do this. Off the top of my head, these are some of the ways:
I suppose there are other ways, but those are the most obvious I can think of.
Hi @Chris D
You can do it by using:
Your Apigee proxy can point to the above mock targets while being developed. Once they are developed and deployed, just change the Target server configuration to point to the live target server. Everything should work as usual 🙂
Hope this helps !!!
I like the idea of relying on an OpenAPI specification document and not having to do a lot of manual configuration after the fact - to minimize the rework that will be necessary by a continually evolving OpenAPI spec.
Any solutions that would take an openAPI spec and spit out a combination of both 1) HTTP routes (nodejs/express or java, either or) and 2) implement those routes to return mock data based on the openAPI spec?
Hi @Sean Freddy - yes, as @Dino mentioned in his other answer, you can generate the server code and set some mock response. You can do it using Swagger generators that are available. You can also use editor.swagger.io --> Generate Server which creates stubs for your API which you can customize to respond with mock data.
Sorry about the confusion with your question drafts, etc.
To answer your question, YES, it is possible to design an API proxy endpoint in Apigee Edge that delivers "test" or mock data to callers. There are multiple ways to do this. Off the top of my head, these are some of the ways:
I suppose there are other ways, but those are the most obvious I can think of.
I like the idea of relying on an OpenAPI specification document and not having to do a lot of manual configuration after the fact - to minimize the rework that will be necessary by a continually evolving OpenAPI spec.
Any solutions that would take an openAPI spec and spit out a combination of both 1) HTTP routes (nodejs/express or java, either or) and 2) implement those routes to return mock data based on the openAPI spec?
Thanks for asking this question & the answers - I'm having the same need for the API mocking.
In my case, AssignMessage policy suits my needs of returning static mock response.
BR & thanks,
Optimism,