SonarQube 6.3 REST API: problems with creating projects via /api/projects/create

1,103 views
Skip to first unread message

Michael Rüegg

unread,
Mar 20, 2017, 5:23:15 AM3/20/17
to SonarQube
Hi,

With SonarQube 6.3, I'm not able to create new projects anymore when using /api/projects/create. I'm aware that there was a renaming in the "key" parameter to "project" in 6.3, but even using that I get the following error:

{"errors":[{"msg":"The 'project' parameter is missing"}]}

with the following input:

curl -H "Content-Type: application/json" -X POST http://localhost:9000/api/projects/create -d '{"project":"my.project", "name":"My shiny new project", "branch":"develop"}'

Any ideas?

Thanks,
Michael

nicolas...@sonarsource.com

unread,
Mar 20, 2017, 5:33:41 AM3/20/17
to SonarQube
Hi Michael,

Not sure the API supports unpacking application/json input (did this work before ?). For now you can stick to a simpler:

curl -u admin:admin -X POST "http://<your_sonar>/api/projects/create?project=my.project&name=shiny&branch=develop"

That works for me.

Best regards,
Nicolas

Michael Rüegg

unread,
Mar 20, 2017, 9:45:29 AM3/20/17
to nicolas...@sonarsource.com, SonarQube
Hi Nicolas,

Thanks for your feedback. Using query parameters made it work. Yes, I think this service was working with JSON unpacking before 6.3.

Best regards,
Michael

-- 
You received this message because you are subscribed to a topic in the Google Groups "SonarQube" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sonarqube/N08cGbb6Jzw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/77cc70b5-ef47-41e7-b6f0-56a0394e8f97%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Simon Brandhof

unread,
Mar 20, 2017, 10:25:54 AM3/20/17
to Michael Rüegg, nicolas...@sonarsource.com, SonarQube
For your information JSON input has never been supported here.

You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/947BF392-D9C9-41E4-9AA3-89BBA2DA61F1%40gmail.com.

For more options, visit https://groups.google.com/d/optout.
--
Simon BRANDHOF | SonarSource
Tech Lead & Co-Founder
http://twitter.com/SimonBrandhof
Reply all
Reply to author
Forward
0 new messages