I got the question to implement search in my Swagger UI which uses localhost.
I have been searching online and I didn't find an answer for this.
My question is: "Is it possible to implement search in the Swagger UI, so people can search for a path of the API?"
Thanks in advance!
I have received an answer on the official Swagger community page on Google groups.
They suggested the following page on github and this was just what I was looking for. It is a very nice looking search implementation in the Swagger UI.
https://github.com/swagger-api/swagger-ui/pull/2116
Anyway thanks for answering to my question!
This swagger-ui don't have a ui-search option so far. But as a solution you have 2 options.
By default swagger-ui list down the set of apis based on the paths (annotated by #Api() on api code). In the below example it has listed down apis based on 2 paths (price-checks and pdp-details).
2.You can explicitly tell swagger-ui to only show apis listed under specific path. In below example, it shows apis listed under price-checks only.
To do that, you have to configure that path-doc with swagger.
Refer this for more info about swagger-annotations.
UPDATE:
In- built swagger-ui search is now available.
There is a repository in githubswagger search that can search API's across projects and search API in swagger document by command(ctrl)+F.
Related
I have some questions regarding swagger-ui. I have downloaded the swagger-ui from here and have played around with the index.html and tried modifying it. From what I understand the UI is dynamically generated based on the open api specification doc either in a yaml or json file format. My questions are as follows
How much modification can be done to the UI that is being generated by the Swagger?
Can "Try Out" functionality be modified to have more control? What I want to do is have few input fields which are not generated by swagger and use them as input for an api call, make UI more dynamic in nature.
Does the Swagger-UI depend on any sort of API gateway to make calls to api endpoints?
Thanks,
Salil
How much modification can be done to the UI that is being generated by the Swagger?
Swagger UI can be tweaked in very different ways mainly via JS or CSS.
You can have a look to https://swagger.io/docs/open-source-tools/swagger-ui/customization/overview/
Can "Try Out" functionality be modified to have more control? What I want to do is have few input fields which are not generated by swagger and use them as input for an api call, make UI more dynamic in nature.
You should have a look to the link I shared above but not sure this is doable like this.
If I had to do such kind of thing I would rather look at how to complete the original OpenAPI definition (the yaml/JSON file) before passing it to Swagger UI.
Note that there is also a "interceptor" feature in Swagger UI that allow to modify requests before sending them for instance. This might interest you.
Does the Swagger-UI depend on any sort of API gateway to make calls to api endpoints?
Not at all. Swagger UI just uses your browser to call the API at the URL documented by the OpenAPI file.
Stack Overflow doesn't work well when there are multiple questions as part of one "Question". Having said that, I'll answer what I know.
As far as I can tell, you can modify the yaml or JSON source as much as you like. You can write an entire file from scratch, or import it from any editor.
For this sort of testing, I think you might want to look for a more in-depth testing tool such as Postman. That's not something I have any experience with, but from what I hear it could help with "what if I send this request?" sceanrios.
I have created a Jira search filter, using this request:
POST /rest/api/2/filter
This worked pretty well. Now after I created the filter, I want to get automatically subscribed to it.
Is there a way to do it with the REST API? Or is the only possible way to do this manually?
I already found this in the documentation: https://docs.atlassian.com/software/jira/docs/api/REST/7.4.1/#api/2/filter-createFilter
There, I found the "subscriptions" property, but I can't seem to figure out how exactly I have to write this, to get the correct syntax.
Thanks.
There is a JIRA Feature Request that is still being considered for this to be implemented. Please take a look at this for more details.
For now, all we can do is Fetch or Create Filters using the JIRA ReST APIs but editing the subscriptions should be manual tasks.
Please take a look at the following Atlassian Question which confirms the same.
Details as provided in this Question:
You can do a GET to see the filter subscriptions values you have via:
GET /rest/api/2/filter/favourite?expand=subscriptions
Hope this helps!
I'd like to know if the following is possible.
Swagger is almost what I need to document a Message based API. For instance for a Command Message I'd like to say "Command" instead of "Post", and instead of "path" I'd like to have the name of the Command.
The spec mentions that Vendor Extensions are possible using "x-" properties but I am 1) not finding any examples of how to do this and 2) not sure if the use of these properties would help me meet my goals.
Might anyone be able to point me to some resources that can help me move along?
Swagger is designed to document REST APIs which are based on HTTP verbs. You can't replace verbs or invent new ones.
Vendor extensions are there to allow adding additional information that the specification does not allow, but ultimately, it is still intended for REST APIs.
From what I gather, you're trying to describe something different.
We do welcome suggestions for additional roads for Swagger (that is, cover non-REST APIs), and in order to do that, I'd suggest opening an issue on the swagger-spec repository.
I am trying to get twitter feeds in to my shopify site. I want to get the feeds and style them as I want and thus cant use a app.
I know how to do it using PHP but can not use that code in shopify and looking for a way I can use OAuth in shopify and get the feeds. I tried the shopify docs but without an example its kinda hard to actually get my head around it.
http://docs.shopify.com/api/tutorials/oauth
Thats the link I am using as a guide. If anyone can direct me to an example which might be similar that would be awesome. (google didnt seem to be that helpful this time either)
Cheers
I know you said you didn't want to use an app, but can I suggest taking a look at Twitify? You can use custom CSS to style your tweets. Also see discussions about Twitify here and here.
Twitter changed their display guidelines and policies on embedding of tweets on websites in June 2013. One of the themes I used for a client earlier in the year had custom styling of tweets, and they have now changed it to use the official Twitter widget to meet the new guidelines. In fact, the images on the Shopify theme store show how it used to look before Twitter changed things:
And after:
I think using an app like Twitify would be the easiest way to deal with these changes to embedding tweets.
Thanx for the suggestion. I did take a look at that before I posted this question. This is a project for a client and I dont think getting a plug in is a viable option. Anyways I found a work around.
Hosted the file on a server and then accessed it. So that resolved the problem. :)
I used node.js to write the script and get the posts as required.
Cheers.
you can use the app for that Twitify https://apps.shopify.com/twitify or you can Embed a Twitter feed in your online store
Go to your Twitter settings.
Click Widgets to open the widgets menu.
Create a new widget, following Twitter's instructions.
Copy the embed code.
I wanted to integrate GSA with Rails. But the web proved to be un-helpful. Anybody knows any step-by-step tutorial.
First, you have to call the GSA with the search query. The reference informations for generating the GET-request is here: http://code.google.com/apis/searchappliance/documentation/610/xml_reference.html#SubmittingaSearchRequest
Then you will receive a xml response from the GSA with all needed information inside. The reference for the xml nodes are here (Look better at a xml response from your GSA and get additional informations in my link): http://code.google.com/apis/searchappliance/documentation/610/xml_reference.html#results_xml_tags
Last but not least, you have to parse the informations within the xml and generate your custom frontend.
I hope that will help you. It isn't really complicated.
Define "integrate" closer. The most things are language independent and have nothing to do with Rails/Java/.Net or whatever
Try using the gem rails-gsa this will help you a lot in integrating the Google Search Appliance with your rails Application.
Check out the documentation on github https://github.com/rohit9889/rails-gsa