Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

How to generaty proxy from swagger file with validations (path and http method restriction)?

So, I have created a spec with 1 endpoint, for example v1/accounts and method GET. When I am generating proxy in Apigee from this spec its generates me folowwing:

<Flows> <Flow name="V1AccountsGet"> <Description>Return list of accounts for specified customer profile</Description> <Request/> <Response/> <Condition>(proxy.pathsuffix MatchesPath "/v1/accounts") and (request.verb = "GET")</Condition> </Flow> </Flows>

And if I invoke apigeehost/test/v1/accounts method GET - it goes to backend.It is OK

If I send apigeehost/test/v1/accounts method POST - it goes to backend.It should return an error?

If I send apigeehost/test/v1/accounts/123 - it goes to backend.It should return an error?

And my question is why Apigee is allowing to make calls with wrong HTTP methods and wrong http path, which was not defined in the swagger?

Usually all those validations I am adding manually which sometimes takes too much time.

0 3 332
3 REPLIES 3