where is the swagger spec file kept? - rest

So I am building a Rest API and have used a swagger YAML file to define the API.
I use the swagger editor to view the spec but how do I host / make it available for everyone in our company to browse ?
Does the swagger get bundled with the actual deployed code and then it is accessible ?

You will need to host it somewhere. Either simply as a downloadable file, or embedded in an application such as Swagger UI.

Related

APIs automation in Apigee using OpenAPI spec

I have created an apigee API proxy using swagger file, then I modified my swagger file (I added a new endpoint) but this new endpoint doesn't display until in apigee UI until I add it manually (In conditional flows), Is there a rest API provider by Apigee or something allows us to update the endpoints in Apigee dynamically by the edit of the swagger file? and thank you
I am not sure which Apigee version you are on but the Specs menu on Apigee Edge should allow you to do this. However, this is not available on Apigee-X.
For the management API you would have to create your own script that modifies the endpoints on update.

How can I configure the path Quarkus uses for openapi and health?

As an experiment I am migrating a Spring Boot service to Quarkus.
In the Spring service all the Spring-provided endpoints (including swagger and health) are under /manage (it makes it easy for us to prevent external access to them).
I can see how to change the path for Swagger UI in Quarkus, and I can see how to change the base path for RESTeasy, but I can't see any way to change the paths for the other Quarkus-provided endpoint.
Thanks.
The short answer:
quarkus.resteasy.path=/api
quarkus.smallrye-health.root-path=/manage/health
quarkus.smallrye-openapi.path=/manage/openapi
It seems Quarkus has 'secret' (well, build-time) dependencies on deployment components like SmallRyeHealthProcessor.java.
Once that's been located it's pretty simple to find the Config class that contains the path.

How to integrate an API Connect API as a BFF into a Bluemix mobile project?

Trying to use an API Connect generated app as the backend for my mobile project adding an OPENAPI_SPEC env variable as defined here:
https://console.ng.bluemix.net/docs/mobile/sdk_compute.html#definition
I can add the app as a compute instance in the Mobile Project UI but it can't generate the SDK, I guess it is because when published via APIC Editor to Bluemix the Loopback app isn't accessed directly but through the APIC gateway.
Any suggestion here?
I would presume that although you have an OPENAPI_SPEC environment variable, your Open API swagger doc isn't valid.
When you download the project, it will auto-generate an SDK corresponding with your backend's Open API document.
For instance, here is how you set the environment variable with an example relative path:
And here is a valid API doc that it's using (albeit not in the most elegant Open API compliant format yet but it works).
https://updatesdk.mybluemix.net/explorer/swagger.json
A good way to test the validity of your OPEN API swagger doc is using the new Bluemix SDK Gen CLI Plugin.
$ bx sdk validate
NAME:
validate - Determines if an OpenAPI specification is valid for SDK generation
USAGE:
bluemix sdk validate OPENAPI_DOC_LOCATION | APP_NAME
OPENAPI_DOC_LOCATION - is a raw OpenAPI specification (URL to spec or local file; json or yaml)
APP_NAME - is the name of an app running in your current space hosting
OpenAPI spec.
In addition, IBM provides a deployable BFF starter sample with an accompanying blog post which may be helpful.

Azure Service Fabric and API Management Integration

I have provisioned a service fabric cluster on azure. It has two node types: one for the frontend and the other one for the backend.
I have deployed a Stateless self-hosted API on the frontend node-type. Now what i'd like to do is to expose that service through the Azure API Management. I've been trying to import the API without success. I have also tried to use swagger to generate the service specification but it seems that swagger does not work. I can access the swagger URL but it loads a blank page.
Any suggestions on how I can integrate my stateless service with APIM or how swagger works here?
Thanks a lot.
there are a few different ways you can produce your swagger document. If you are using Web API, you can use SwashBuckle to generate your Swagger for you. To validate your swagger file, you can use Swagger Editor. Finally, if you still have problems once you have validated your swagger document, share the document and the error here and we will see what we can do to assist.
Many thanks

how to solve SOAP services issue with portable class library?

i have an issue using SOAP services from portable class library.
once i add the service refrence configuration file created empty and calling any operation form Windows Phone or Windows store app project returns null value.
However if i added the refrence to WP or W8 project directly configuration file is npot empty and operations return data
any reason for that ?
It is the same as in full .NET. If you call a web service, the configuration file is searched for in the calling assembly, that is in your case the WP8 project.
You have two options. One is to copy the relevant configuration from app.config in the PCL to the WP8 porject or to create the web service configuration completely in code in your PCL so no config file anywhere is needed.