I'm working on a API project on a hybrid cloud. APIs are hosted on-premise and via the cloud service (Azure API Management service), the APIs are exposed to the external world. For any APIs, we are writing the contract in Open API Specification as Yaml file manually and then import it into Azure APIM. Everytime yaml is imported in APIM, the version number in the Yaml get's reset to 1.0, even though it is something different in the Yaml file (unless we modify it manually after the import). This is creating confusion on what version is in the cloud vs what version is there locally. So, I'm looking for option if anybody faced this issue and how did they resolve it? One of the workaround solution that we have been doing is writing the version number in description when revising the version in Azure APIM.
You could create a new version of an existing API and then import your updated OpenAPI spec using the update method as below
Also, something that you might already be doing is to maintain your OpenAPI specs in a git repository for version control since its like any file.
Related
When creating a new Spring Boot project using Spring Initializr and adding Azure Support, it adds a dependency to com.microsoft.azure:azure-spring-boot-starter.
implementation 'com.microsoft.azure:azure-spring-boot-starter'
The spring cloud documentation says:
The Azure Support entry contains auto-configuration support for Azure
managed services [...]
Now I'd like to send and receive messages from Azure Service Bus and the documentation wants me to add a dependency to azure-servicebus.
implementation 'com.microsoft.azure:azure-spring-boot-starter'
implementation 'com.microsoft.azure:azure-servicebus'
Okay fine. When I now switch over to Microsoft and read the documentation about Service Bus there, it mentions two libraries, where Microsoft states the second one is dated and legacy.
azure-messaging-servicebus (latest) implementation 'com.azure:azure-messaging-servicebus:7.0.0'
azure-servicebus (legacy) 'com.microsoft.azure:azure-servicebus'
Question
Is the Spring Boot documentation just outdated?
I have read somewhere that libraries in com.microsoft.com are for managing the resource itself, while libraries in com.azure are for managing the data. Is this true?
What is meant by auto-configuration support?
As you can see I am very confused which dependencies I need to add. Also I don't get the difference between packages from com.azure and com.microsoft.azure.
Can someone please shed some light on this?
Is it possible to import OpenAPI/Swagger 3.0 specification file to create APIs in OpenWhisk? I am able to import 2.0 specification file, but when I convert the file to 3.0, I hit the following error.
error: Unable to parse swagger file: Swagger file is invalid (missing basePath, info, paths, or swagger fields)
I am using open source OpenWhisk on self hosted Kubernetes cluster, not the one hosted on IBM Cloud.
Not yet but the project welcomes contributions. Some of the route management API and the OpenWhisk CLI will require adjustments to align the schema with OpenAPI.
I created my project by using S/4HANA SDK (spring boot archetype), now I need the functionality to provision some ODATA services so I also introduce the dependency com.sap.cloud.servicesdk.provodatav4 to my project and then create metadata file and odata service implementation class. However, after packaging my project into jar file and run it, I get null pointer exception from the class com.sap.cloud.sdk.service.prov.v4.rt.core.web.ODataApplicationInitializer. After seeing the source code of this class, it seems it use "File" object to get metadata file from classpath, but this way doesn't work in a jar file. My question is: does it mean I have to change the packaging way to "war" in order to use this SDK for odata service development? Thanks very much.
The unfortunate answer is that, as of today, the Service SDK (not the S/4HANA Cloud SDK) is only compatible with pure Tomcat environments and assumes the Servlet standard as well as surrounding mechanisms as the default mean. The reasons for this is that the Service SDK is an integral part (the runtime) of the SAP Cloud Application Programming Model which is self-contained and may not be combined with arbitrary frameworks such as Spring Boot.
Adding to Philipp's answer that this is not supported, you may be able to use the traditional deployment here. However, since this is likely not supported officially, I would encourage to consider an alternative approach.
Does anyone know of a link to a useful documentation on how to add swagger documentation to an existing aws lambda (API Gateway)? Some sort of a noob tutorial as I am totally new to swagger.
I have found some links, such as the following, which were not so useful or not specific to lambda:
https://blog.cloudboost.io/adding-swagger-to-existing-node-js-project-92a6624b855b
https://github.com/swagger-api/swagger-node
I have only used Swagger with API Gateway with the old v0.5 version of serverless framework as there was a plugin that supported this easily.
However, when serverless matured into v1.0 and up, at that time, there were no good plugins for Swagger integration.
Here are links you can check:
Serverless Github Issue: Swagger Integration
Reckon-Limited/serverless_swagger
doapp-ryanp/serverless-plugin-swag
I don't personally use the above though as my big serverless projects are now using GraphQL (where API documentation is part of the standard tooling :-) instead of REST.
In my backend team we do the documentation using a tool that smart bear makes available, the swagger inspector and through it we finish adjusting the doc with the swagger hub.
Swagger inspector makes a request on your endpoint and basically extracts the necessary documentation, but some things you need to adjust, it is not the best solution, but it helps ...
I'm building "read-only" webservice (Google Cloud Endpoints as backend for an Android App) so I created a project using maven:
mvn archetype:generate -Dappengine-version=1.9.10 -Dfilter=com.google.appengine.archetypes:
and selecting archetype hello-endpoints-archetype to have some sample code to work on.
This works well and my app is correctly calling the service as expected (and the service is correctly supplying the data in return).
Now I have to implement an "update" service to periodically (4 to 6 times a dya) update the data supplied to the app. So I added a servlet to my project to be called by cron. Trouble is: one of the library used during this update uses multi-threads which cause an AccessControlException to be thrown because apparently multi-thread is only allowed in backend modules...
But after having read dozens of pages on google app engine, I still don't know how to "break" my application into modules so that particular servlet would be run as a backend module while the already existing servlet keep working as they do. So far, all I got was that I should use an EAR application composed of several WAR modules, but I don't even know if my current application is an EAR or not...
I'm using Eclipse Luna, maven 3.2.1 (embeded with Eclipse), google app engine 1.9.10, writing in Java
Could anyone please help me by explaining the directory structure and/or configuration files I have to look at, modify and/or add?
Thanks for any help provided!
You can find an example of multi-modules project here.
However, note that even in backend modules the threading is limited to 50 threads, as stated here.