How to mention parameter dependency in swagger - swagger

I have 2 api calls such that the parameters required to call the second Api depends on the response generated from the first Api call.
Is there anyway in swagger to show such dependency in UI.
Thank you

You can't. You can document it verbally in an operation description but you can't document the dependency of one operation on the other.
This implies a flow of API calls which means they are not quite stateless, and that goes against the standard REST API design.

Related

Swagger (SpringDoc) UI requests throught gateway

It seems that when we use Swagger (SpringDoc) UI for the gateway, when a request is sent through it, the request is made directly to the service and not through the gateway. For example, in this example (linked from SpringDoc documentation), the swagger ui address is 158.101.191.70 while the request is being made to 172.17.0.9.
Isn't an important point of using swagger to let API users know what APIs we have and be able to test them? Thus, shouldn't the requests be made through the gateway and not directly? Maybe, they don't even have access to the services directly. Is there a solution?

How to use AngularDart with payment request API? or does the payment request API exclusive to Javascript?

Usually payment request API being used with Javascript, is there any example on how to use payment request API with AngularDart? as for now i never seen someone using it which make me think is that possible. Or does the Payment Request API intended to be used by only javascript?
So Dart can call any JS in the browser using package:js https://pub.dartlang.org/packages/js
In terms of GoogleUIs it is pretty easy to generate the RPCs in a couple of different languages using: https://github.com/dart-lang/discoveryapis_generator
Here are some examples that are made with that: https://github.com/dart-lang/googleapis

Difficulty in understanding interceptors headers

why we are adding headers in interceptors?I have gone through several websites and I can't understand
Adding headers is not the purpose of interceptors. Header manipulation is just one of the things you can do in interceptors IF the need arises. It's up to you to use them if/when you need to.
Examples I've used interceptors for:
Adding client-side caching functionality for certain specific service calls.
Faking a back-end call for a demo application such that the http call does not go through with the full call to the server.
The documentation provides an explanation and a few examples including ensuring that requests are made via HTTPS, some help with authentication settings, and manipulating request bodies.

Using BreezeJS for internal and external API

I need some advice on how to proceed with this design please:
I use BreezeJS internally on top of my Entity Framework Web API. So
all my data retrievals and saves are done in the Breeze style.
I now need to expose an API for external consumption which has a subset of
the calls I use internally.
Ideally I would like to consume the same API internally.
I do not want to tell the consumers that they have to
use BreezeJS on their client-side to consume my API (I am using
Swagger on top of it)
So, for now I have a separate set of API calls for the External API which go through different validation code and have a structure like:
Get(item)
Get(items)
List item
Post(item)
etc.
My question is: Am I going down the wrong track? Should I either be using BreezeJS on the ExternalAPI or stop using Breeze internally and consume the External API, OR should I perhaps wrap the ExternalAPI methods around Breeze and restrict the saving of the entity graph to the entity type that is being queried at the time only?

Data fetch using OData API in ios

I an new in iPhone.Currently i am working on OData based web service. But i am little confusing with how to call webservice and getting response with OData.I have below information with me.
The metadata of this service is located at :
http://enumbler.azurewebsites.net/odata/$metadata
and Base url is :: http://enumbler.azurewebsites.net/odata/User
Can anyone help me to solve this?
Thanks in advance.
I'm not familiar with IOS, but I may help with common way to consume OData services. Take one OData sample service TripPin, if you want to get all airlines, you can simple calling http://services.odata.org/V4/TripPinService/Airlines. The response is in JSON payload, you can consume this either directly dealing with JSON or use some OData client libraries for IOS. One difference your service and the sample service has may be that TripPin is OData V4 and your service is OData V3. Maybe your service doesn't support JSON but ATOM payload, but you can deal with either way I mentioned above. For more detailed information of OData, you can go directly to OData.org. Hope I helped you with part of your problem.

Resources