Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Native API: publish dataset endpoint mismatch (POST vs. GET) in docs vs. code #2431

Closed
pdurbin opened this issue Aug 4, 2015 · 4 comments
Closed

Comments

@pdurbin
Copy link
Member

pdurbin commented Aug 4, 2015

http://guides.dataverse.org/en/4.1/api/native-api.html#datasets says...

Publishes the dataset whose id is passed. The new dataset version number is determined by the most recent version number and the type parameter. Passing type=minor increases the minor version number (2.3 is updated to 2.4). Passing type=major increases the major version number (2.3 is updated to 3.0):

POST http://$SERVER/api/datasets/$id/actions/:publish?type=$type&key=$apiKey

... but the method actually takes a GET rather than a POST:

curl -X GET -H "X-Dataverse-key:$API_TOKEN" http://localhost:8080/api/datasets/2675227/actions/:publish?type=minor

Probably it should be a POST, as documented, since we're changing state on the server. Yes, this will break backward compatibility of the Native API but I think it's worth it.

I'll set this issue for the current milestone for now and pass to @scolapasta for assignment.

@pdurbin pdurbin added this to the 4.2 milestone Aug 4, 2015
@bencomp
Copy link
Contributor

bencomp commented Aug 4, 2015

What was the result/status of investigating tools like Enunciate for generating REST API documentation based on Javadoc? I love documentation (and cannot link #775 enough ;)), but in situations like these I'd think no mismatch between code and documentation would have existed.

@pdurbin
Copy link
Member Author

pdurbin commented Aug 4, 2015

Huh. Enunciate wasn't really on my radar but I see you did mention it at http://irclog.iq.harvard.edu/dataverse/2015-01-07#i_15039 . (I was thinking more of Swagger back then.) I do love me some documentation.

As a first step, it might be interesting to at least compare Enunciate output to our docs as a sanity check. Of course, more integration tests would probably also find mismatches like this. (I'm actually working on writing more right now, which is how I found it.)

@pdurbin
Copy link
Member Author

pdurbin commented Dec 22, 2016

Fixed in pull request #3550. Passing to Code Review at https://waffle.io/IQSS/dataverse

@raprasad raprasad removed their assignment Jan 3, 2017
@kcondon
Copy link
Contributor

kcondon commented Jan 13, 2017

Now supports POST in addition to GET (so as not to break existing implementations).
Closing

@kcondon kcondon closed this as completed Jan 13, 2017
@kcondon kcondon self-assigned this Jan 13, 2017
kcondon added a commit that referenced this issue Jan 13, 2017
@djbrooke djbrooke added this to QA 👍 in IQSS/dataverse May 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants