Swagger interface, code and definitions

89 views
Skip to first unread message

Monica Duke

unread,
Aug 8, 2018, 9:25:37 AM8/8/18
to ORCID API Users
Has ORCID made available the code that is being used to deliver the Swagger interface please? I had a look at https://members.orcid.org/api/resources/code-examples and couldn't spot it.

Secondly, I think there may be an error in the swagger definition at https://pub.orcid.org/resources/swagger.json

Is this the current definition URL ? I've taken it out of orcid-js code..... if the URL is correct should the line "$ref" : "#/definitions/Fundings" say Employments , in the employments definition?

Many thanks,
Monica

"/v2.1/{orcid}/employments" : {
"get" : {
"tags" : [ "Public API v2.1" ],
"summary" : "Fetch all employments",
"description" : "",
"operationId" : "viewEmploymentsV21",
"produces" : [ "application/vnd.orcid+xml; qs=5", "application/orcid+xml; qs=3", "application/xml", "application/vnd.orcid+json; qs=4", "application/orcid+json; qs=2", "application/json" ],
"parameters" : [ {
"name" : "orcid",
"in" : "path",
"required" : true,
"type" : "string"
} ],
"responses" : {
"200" : {
"description" : "successful operation",
"schema" : {
"$ref" : "#/definitions/Fundings"
}
}
}
}
},


Monica Duke
Jisc UK ORCID technical and community support co-ordinator
Jisc ORCID Consortium support desk he...@jisc.ac.uk
Skype monicabonett
Twitter mbonett
Working hours Monday to Thursday 9.00 to 15.00
jisc.ac.uk

Jisc is a registered charity (number 1149740) and a company limited by guarantee which is registered in England under Company No. 5747339, VAT No. GB 197 0632 86. Jisc’s registered office is: One Castlepark, Tower Hill, Bristol, BS2 0JA. T 0203 697 5800.

Jisc Services Limited is a wholly owned Jisc subsidiary and a company limited by guarantee which is registered in England under company number 2881024, VAT number GB 197 0632 86. The registered office is: One Castle Park, Tower Hill, Bristol BS2 0JA. T 0203 697 5800.

Tom Demeranville

unread,
Aug 8, 2018, 1:03:56 PM8/8/18
to ORCID API Users
Hi Monica,

The code that is used to build our swagger interface is contained in the JAX-RS server components.  We annotate methods and the swagger library turns those into the swagger.json.   https://pub.orcid.org/resources/swagger.json and https://api.orcid.org/resources/swagger.json are the two files that get generated.

Line 419 here is generating the member version of this call: https://github.com/ORCID/ORCID-Source/blob/master/orcid-api-web/src/main/java/org/orcid/api/memberV2/server/MemberV2ApiServiceImplV2_1.java

Line 257 is generating the public version here: https://github.com/ORCID/ORCID-Source/blob/master/orcid-pub-web/src/main/java/org/orcid/api/publicV2/server/PublicV2ApiServiceImplV2_1.java 

Looking at it, I can see that the public version is incorrect, which is why you are seeing this problem in the swagger.json.   I have raised a card (https://trello.com/c/wyrs473o/5170-fix-swagger-employments-in-public-api) and will get this fixed ASAP.

Thanks for the heads up and sorry if it's causing problems.

Tom.

Monica Duke

unread,
Aug 9, 2018, 4:27:45 AM8/9/18
to ORCID API Users

Thanks Tom 

 

I was still looking at the swagger.json to take a guess at how to change orcid-js to search and return employments instead of activities so I did just spot it before debugging any code, so no worries.

 

I’ll have a look at the generated java next.

 

I’m doing a bit of tinkering around to keep myself in practice, but also thinking about the search tool that produces results in a more user-friendly format for our members that want to dig around for ORCID users that are not connected to their systems yet, to target their advocacy. 

 

Monica

 

--
You received this message because you are subscribed to the Google Groups "ORCID API Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orcid-api-use...@googlegroups.com.
To post to this group, send email to orcid-a...@googlegroups.com.
Visit this group at https://groups.google.com/group/orcid-api-users.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages