I have implemented the api
#GetMapping("/mqsql-data/{tableName}")
public List<String, Object> getTableData(#Parameter(name="sigma", schema=#Schema(type="string", defaultValue="sigma") #PathVariable String tableName) {
return service.getData(tableName);
}
added dependency : org.springdoc:springdoc-openapi-ui:1.6.11
It is generating swagger ui.
when I am calling my api from browser and postman, I am getting the data means code is working fine but If I am trying to hitting api from swagger ui, value to tableName is not passing and getting below syntax error
Incorrect syntax near '}'. I debug the code It is not taking tableName from swagger ui page.
Can anybody help on this. Thanks in advance
Related
When I am using the Jira Api to get an issue, it throws the following exception:
org.codehaus.jettison.json.JSONException: Missing value. at character 169402 of
{"expand":"renderedFields,names,schema,transitions,operations
.... lot of other information fetched for that particular issue.
I am using com.atlassian.jira.rest.client-2.0.0-m31.w2
Below is the code I am using :
JiraRestClient client = factory.createWithBasicHttpAuthentication(jiraURI, username, password);
IssueRestClient issueClient = client.getIssueClient();
Promise<Issue> issue = issueClient.getIssue(jiraNumber);
keyIssue = issue.get();
jiraURI is the Jira system our company is using something of the form https://jiratest.int.kronos.com
The object issue contains the json exception mentioned above.
Can you please help me out ?
I'm working on a project which use the mediawiki API and I have this error :
error code=mustpostparams
info:'The following parameters were found in the query string, but must be in the POST body: lgpassword, lgtoken.'
This is my code :
Mediawiki wiki=new Mediawiki(site);
Login login=wiki.login(login,password); //error
wiki.edit(title, content , summary);
wiki.logout();
To login to my mediawiki I use login action but I think I can use query action.
In the documentation : https://www.mediawiki.org/wiki/API:Tokens I found :
PARAMS = {
'action':"query",
'meta':"tokens",
'type':"login",
'format':"json"
}
I think it's exactly what I need but it's in python and I don't know how to do this in Java. I know that there is a function getQueryResult() but I don't know how to use it.
How to do the query action in Java ?
Thanks
Like this post, both are related :
I just add
Mediawiki wiki=new Mediawiki(site);
wiki.setVersion("Mediawiki 1.28"); //New
Login login=wiki.login(login,password);
And don't forget to use a bot ! https://www.mediawiki.org/wiki/API:Login
I am using wikidata api to fetch a entity using its english title,
wdf = WikibaseDataFetcher.getWikidataDataFetcher();
eid = wdf.getEntityDocumentsByTitle("enwiki", entitle);
Earlier, with an older version of wikidata-api, I was able to run it smoothly.
After updating to version 5.0.0, I always get the following error,
Exception in thread "main" java.lang.NullPointerException
at org.wikidata.wdtk.wikibaseapi.ApiConnection.fillCookies(ApiConnection.java:544)
at org.wikidata.wdtk.wikibaseapi.ApiConnection.sendRequest(ApiConnection.java:346)
at org.wikidata.wdtk.wikibaseapi.WbGetEntitiesAction.wbGetEntities(WbGetEntitiesAction.java:187)
How to fix this?
I get the same problem.
I tried to use latest version from github and get the same exception.
I execute the sample from documentation i.e the simple call:
Map<String, EntityDocument> results = wbdf.getEntityDocuments("Q80", "P31");
Seems code doesn't check for existence of a given cookie.
I added the verification, recompiled and everything seems to work.
Go to ApiConnection.java:543
if (headerCookies != null)
for (String cookie : headerCookies) {
No warranty ! :-)
I have a requirement where I need to insert the value to custom data tag using thymeleaf. The code for doing it using
data-th-attr="${data-custom=#messages.msg('test')}"
as well as
th:attr="data-custom=${#messages.msg('test')}"
I am unable to get the value in both the cases.
ultimately the parsing should be like data-custom="test"
here test is key for the value test in a properties file
By using the
data-th-attr="data-custom=#{test}"
or By using
th:attr="data-custom=#{test}"
helped me out, here test is the key for the value in message resource the issue was with the intellij IDEA IDE, it was having a bug that was showing me an unnecessary error.
Use th:attr="data-custom=#{key.for.message}" , this should work.
then after parsing the Expression,
data-custom="value.for.message"
I've found this guide on internet to publish on Wordpress using XML-RPC inside my Java Project, for example I want a message on my Blog, every time it's specified date.
http://wordpress.rintcius.nl/post/look-how-this-wordpress-post-got-created-from-java
Now, I've followed the guide and I'm trying to let it run but I don't understand yet how exactly parameters for my post works.
For example using the method blogger.NewPost I call:
public Integer post(String contents) throws XmlRpcException {
Object[] params = new Object[] {
blogInfo.getApiKey(),
blogInfo.getBlogId(),
blogInfo.getUserName(),
blogInfo.getPassword(),
contents,
postType.booleanValue()
};
return (Integer) client.execute(POST_METHOD_NAME, params);
}
and my "contents" value is:
[title]Look how this wordpress post got created from java![/title]"
+ "[category]6[/category]"
+ FileUtils.getContentsOfResource("rintcius/blog/post.txt");
(I'm using "[" instead of "<" and "]" instead of ">" that are processed by stackoverflow)
Now, how could I use all parameters in this XML way?
Parameters here: http://codex.wordpress.org/XML-RPC_MetaWeblog_API#metaWeblog.newPost
And, it's the content only a "string" without any tag?
Thanks a lot to all!
Still don't know why it gives me back errors but i think it's only a bit outdated.
Found this other libraries that works perfectly
http://code.google.com/p/wordpress-java/
I advice all to use this since the other one is outdated
Thanks all