We are using swagger for one of our java rest services , but I am not able to change the API name for those. I tried changing the api names by different ways, but still it is displaying in different format while accessing the swagger-ui.
For eg: if my API name is EmployeeApiService , in swagger-ui, it is displaying as employee-api-service.
Please find the details :
Maven Dependencies: springfox-swagger2 and springfox-swaagger-ui with both as version 2.7.0
Ways I tried:
1). By giving #API annotation with tags i.e.
#Api(value="EmployeeApiService", tags={EmployeeApi})
2). By giving #SwaggerDefinition .
In both cases, the api name is not getting changed in swagger UI.
Please help.
Related
I am pulling a file from on premise TFS source control using the Rest API. I can't find on premise specific documentation, but it seems to be very close to version 4.1 of the Azure Get Item call. According to this documentaiton, it should return a TfvcItem object which has a lot of metadata including the version. However, when I make the call it only returns the file contents (the content field of the documentation's TfvcItem).
How do I get the current version of the file?
I need the version when I check itin with create changeset. I don't need it for any other reason, so if you know another way to check in an edited file that would help.
Instead of using Get Item API, some related REST APIs are not documented. For these REST APIs we can use tools such as Fiddler or directly press F12 - network in Chrome to track them.
You should use below API to fetch latest changeset version of a file:
post https://dev.azure.com/{organizationname}/{Projectname}/_api/_versioncontrol/history?__v=5
For body:
{"repositoryId":"","searchCriteria":"{\"itemPath\":\"$/MyFirstProject/Main/1.txt\",\"itemVersion\":\"T\",\"top\":50}"}
itemPath is your server path of the file.
From the response, you will get the version info such as "version": "139", instead of the file content.
Not sure your detail version of TFS, I was using Azure DevOps Service for an example. There maybe some difference for different TFS version. You could track the detail API on your own side.
More detail info kindly take a look at this question: VSTS Release API Documentation
Had the same issue. You can get item metadata by specifying "scopePath" URI parameter, instead of "path". Microsoft example in API documentation seems incorrect, as it indeed returns only item content: https://learn.microsoft.com/en-us/rest/api/azure/devops/tfvc/items/get?view=azure-devops-rest-6.0#get-item-metadata-and/or-content-for-a-single-item.
Official documentation for retrieving OneNote documents under an Office 365 Group states to use the URi format:
https://graph.microsoft.com/{version}/groups/{id}/onenote/{notebooks | sections | sectionGroups | pages}
Constructing a GET request of the format:
https://graph.microsoft.com/beta/groups/{id}/onenote/notebooks
fails for me, with a 400 error. No detailed information on why it failed is returned. If I run the same query through Graph Explorer, I get Unsupported segment type. ODataQuery: groups/d11c2cd1-8b41-48ee-b512-93921e19f741/onenote/notebooks
However, the following URL does work:
https://graph.microsoft.com/beta/groups/{id}/notes/notebooks
Note the difference here, using "notes" instead of "onenote". This works from the command line for me (PowerShell) and using Graph Explorer. I can also substitute "notebooks" here, for "pages" or "sections" and again this works with PowerShell or Graph Explorer.
Now, Create Notebook suggests a post to https://graph.microsoft.com/beta/groups/{id}/onenote/notebooks, and whether I try this, or https://graph.microsoft.com/beta/groups/{id}/notes/notebooks it still fails either programatically or through Graph Explorer.
It looks as though there used to be some "notes" documentation at https://github.com/microsoftgraph/microsoft-graph-docs/blob/master/api-reference/beta/resources/notes.md but this doesn't exist.
I'm unclear why "onenote" fails for everything, and "notes" works for getting notebooks/pages/sections but not creating a notebook.
Thank you in advance.
We are preparing the service for an update and the documentation went live a day before the service update. Stay tuned for a blog post by 5/4/17 that outlines the details of all the updates for the OneNote API.
i'm trying to use swagger-codegen-maven-plugin to generate my interface .
after compiling with the plugin - it generates all the files correctly but for some reason
the interface name is DefaultApi.
i looked for some configuration that i can change the name of the interface that been generated but didnt find the solution for that.
any idea on that??
"DefaultApi" is used when there's no tags specified for the endpoint.
For example, this endpoint will be put in a class named "UserApi" since the tags is set to User.
You will need to update the spec to include proper tags for endpoints to avoid using "DefaultApi"
UPDATE: On May 2018, about 50 top contributors and template creators of Swagger Codegen decided to fork Swagger Codegen to maintain a community-driven version called OpenAPI Generator. Please refer to the Q&A for more information.
After reading the documentation about the new 4.6 versioning feature and this post In Orbeon Forms, is form version information available in the REST API? I was wondering how the form builder receives the published version number?
In this screenshot from the builder
you see the latest published version has the value 5.
How does the builder receive this value and is it possible to accomplish this via our own CRUD interface?
The publishing part we got covered by handling the HTTP_ORBEON_FORM_DEFINITION_VERSION header field and its' value.
Looks like the python script I used returned the wrong header field.
Anyway the right headerfield both ways is ORBEON-FORM-DEFINITION-VERSION.
So sending this field with the version number results in the right value in the form builder
I'm using the Jira (version 5) Rest API to Delete a version and like the documentation tell me, I pass the moveFixIssuesTo and moveAffectedIssuesTo to transfer issue from the deleted version to a other version. This just doesn't work. The issues that has AffectedVersion / FixVersion set to the deleted version have no version after the delete.
/rest/api/2/version/{id}?moveFixIssuesTo&moveAffectedIssuesTo
Here an example of the call :
http:// /rest/api/2/version/16238?16237&16237
My {id} is an existing versionId I want to delete.
moveFixIssuesTo and moveAffectedIssuesTo are versionId of the version I want the issues to be transfer.
If I do the same kind of action from the Web UI of Jira ( Deleting a version and setting in the form the version to transfer the AffectedVersion and FixVersion, It work correctly and I see the new version in the field of the issues.
Any idea why this does not work as expected ?
I think if you changed implementation of service operation - you must use another url for this operaton. For this thing you can change value of attribute version in rest tag in the file atlassian-plugin.xml:
<rest name="My Rest Resource" key="custom-rest-resource" path="/my-custom-resource" version="1.0"/>