I would like to use the externalValue of OpenAPI like it's shown in the docs. But it looks like the swagger-UI is currently does not support externalValue (link). Was it ever supported by the Swagger-UI? If so, is it possible to go to some previous version and use it? I have tried to go throughout the release notes and find if it was ever released but could not find it. If it's not supported by Swagger-UI, then why it's described in details in the docs? I'm a bit confused how the OpenAPI/Swagger system works.
If there is no previous version of Swagger-UI which I can use for externalValue, what would be the best option to the current situation? it's a bit difficult to create the examples manually (too big).
Related
The API documentation created using OpenAPI is usually called using the endpoints /openapi (YAML) or /openapi/ui (Frontend).
How can I rename these endpoints for that I can call e.g. /myappapi and /myappapi/ui respectively? (OpenAPI 3)
This massively depends on how you're generating that OpenAPI. From your comment I see that you're using Eclipse MicroProfile and I've not come across that before, but a quick DuckDuckGo shows this extension might be what you're up to: https://github.com/eclipse/microprofile-open-api
I couldn't see any specific config options to change the endpoint, but you could always slap a nginx redirect in there.
If you're finding limitations with the way you're generating OpenAPI to be a problem, I recommend not doing that.
Of all the approaches: Annotations, DSL, writing YAML by hand in text-editors, or GUI's, I can't help but recommend the GUI approach as it allows for API Design First for new APIs and new functionality in old APIs.
I just did a huge talk about that: https://www.youtube.com/watch?v=nfkppuQ-Eg0&feature=youtu.be
Blog version: https://stoplight.io/blog/api-design-first-vs-code-first/
Otherwise, see if you can pick that extension apart and tweak the config options until it does whatever you want. :)
I've read a lot of StackOverflow questions, but there is no good solution for me. I'm searching for a way to document our API with a version number.
We have v1 and v2. So the best way is to generate 2 different swaggers.
The controllers are in different packages and for one version is one controller.
Is this possible with swagger? And how we can do it?
The best way to do this is to use swagger groups. Check out this documentation: Springfox Documentation
Can somebody please explain me what exactly is API versioning and why is it needed. I know how to create versions for api on a rails web app, but I really want to know why is it needed. Before somebody downvotes or flags or anything, I googled , I couldn't find any satisfying answer. I would really appreciate it if somebody answers this.
API versioning allows you to have multiple versions of your API and use them at the same time. With this solution, you are assuring backward compatibility for all of the applications integrated with your API.
Simple example
Your API is used by 10 different applications. You are using Basic access authentication, but you noticed that it could be done better. So, you decided to use modify this and use Oauth.
No API versioning
You will have to wait for all of 10 applications to implement changes before releasing the new API version. Otherwise, you will lose the integration. Of course, you can use if/else statements in your code to distinguish which authentication method should you use but this will be not elegant.
API versioning
You can release new API version whenever you want. Then, you can inform your client, that the old API will be deprecated in 3 months, so they have time to implement changes on their side.
Also, you can ask them to add a param to all requests (to choose which API version they will use), and you can set it by the default to the new version. That will allow you to avoid problems with new applications that want to use your API.
Summary(in my opinion):
Pros
1. clean and elegant code (without additional if/else statements)
2. backward compatibility
Cons
1. sometimes you have to duplicate your code
2. it might look like a complex solution at the beginning but don't be scared
Here you can read about two options of API versioning - URL param and HTTP header
I hope that my explanation is clear and helps you understand API versioning
The main reason for versioning your APIs is to provide a constant structure for everybody using them. Let's say you define an initial API for your service (v1) that you send out to your clients. After some time your app changes, and you maybe want to exclude some fields/add new ones. This would be a problem for the client, since their implementation of your API might break if some fields that they are expecting is missing. So you create a v2 with those features, without breaking the initial functionality.
I have installed jclouds and I am trying to learn how it works internally.
I read all the documentation on the site and on the github but still I have lot of questions about the architecture and implementation of the jClouds.
Do you know where I can find documentation about the deep technical implementation of the framework? I am also looking information on how to add a new provider( for blobstore service)
Currently I am looking into the code but it s not always straightforward what the code does.
The best thing to do is send an email to our dev list. You can subscribe by emailing jclouds-dev-subscribe#apache.org. You can also find us on IRC at #jclouds on freenode.
Adding a new provider is quite an important change for jclouds. The first thing you'll want to do is review How To Contribute. We need to make sure it will work properly and we'll be able to properly test it so don't be discouraged by the reviews.
Having said this, a number of general considerations to take into account when starting a new provider:
New providers are added in labs first, until they are stable.
To follow the jclouds style, use a 3 space indent and a 120 character line length.
We use Guava as our core library. Try to use its utilities before adding new dependencies. In general, do not add dependencies before consulting our dev# list.
We require both live and mock tests. "mock" tests verify that the api generates the expected request according to the method annotations, and that the response is properly parsed. We use MockWebServer to do that, and you can take a look at the MockTests classes in the openstack-swift api to see an example of how these tests work.
Often the best thing to do is to copy the entire directory structure of one of the existing apis or providers and delete everything that you don't need but keep some of the files around in each directory to server as an example of how to do things. You can rename those classes and start your work from there.
Which api or provider should you choose to use as an example for your work? It depends! Please email us on our dev# list to describe the work your doing and we will recommend one. The earlier you get engaged with the jclouds community, the easier the whole process will be.
Good luck!
Perusing through the documentation, I see an endpoint that can be used to update existing Projects, but nothing about creating new Projects. Is this capability not currently supported?
(I work at Asana)
This is indeed supported, though apparently specific mention is missing from the docs. Thanks for asking, we should correct this.