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

RESTWS-560 - Upgrade swagger-ui to 3.0.10 #295

Merged
merged 1 commit into from
Sep 3, 2017

Conversation

gayanW
Copy link
Member

@gayanW gayanW commented Aug 26, 2017

This upgrades swagger-ui to v3.0.10

@mention-bot
Copy link

@gayanW, thanks for your PR! By analyzing the history of the files in this pull request, we identified @zak905 and @psbrandt to be potential reviewers.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.01%) to 40.012% when pulling 5139f19 on gayanW:RESTWS-560 into 639ad02 on openmrs:master.

@gayanW
Copy link
Member Author

gayanW commented Aug 26, 2017

FYI:
The old omod/src/main/webapp/resources/js/swagger-ui/ directory is removed and replaced with omod/src/main/webapp/resources/js/swagger-ui-3.0.10/

Only these two files will need to be reviewed:

@gayanW
Copy link
Member Author

gayanW commented Aug 26, 2017

In the new UI there will be validation errors showing on the top, as shown by the picture. It lists resources that are not yet documented. So for example appframework/rest/AppResource.java

This I think is useful, so we know exactly what to documented instead of having to manually validate the spec.

.description("OpenMRS RESTful API specification")
.contact(new Contact().url("http://openmrs.org"))
.description("OpenMRS RESTful API documentation generated by Swagger")
.contact(new Contact().name("OpenMRS Talk").url("https://talk.openmrs.org"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the reason behind replacing openmrs.org with talk.openmrs.org?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As there is where one could get support. If that doesn't make much sense, lets leave it as it is with openmrs.org

@dkayiwa
Copy link
Member

dkayiwa commented Aug 27, 2017

Each of these three commits should be a separate pull request. If we for instance reject the pull request because of not wanting to upgrade swagger, this should not affect updating of the description and contact information. So do you now see why these should be separate pull requests?

@gayanW
Copy link
Member Author

gayanW commented Aug 28, 2017

@dkayiwa Yeah that makes sense. Since this is about upgrading the UI, may I remove the other two commits?

@dkayiwa
Copy link
Member

dkayiwa commented Aug 28, 2017

Yes, separate them.

@gayanW
Copy link
Member Author

gayanW commented Aug 28, 2017

When you mean separate them, did you mean that we'd need 3 separate issues or just PRs?

@dkayiwa
Copy link
Member

dkayiwa commented Aug 28, 2017

Separate in the sense that when one is rejected, it does not lead into the other not being merged.

@gayanW
Copy link
Member Author

gayanW commented Aug 28, 2017

Three separate PRs could facilitate that requirement. But however do we need to create separate issues for each one as well? :) Can a issue can have a multiple PRs or say that the last two commits are essential, so do we have to create new issues as sub-tasks of the original issue?

@dkayiwa
Copy link
Member

dkayiwa commented Aug 28, 2017

If they fit into the original issue as parent, then they can be sub tasks. But for now, if you can create separate pull requests and include the pull request urls on the ticket, it would be much better than before.

@gayanW
Copy link
Member Author

gayanW commented Aug 28, 2017

I reverted the last two commits. Should I update the PR name/description, and squash things..?

@dkayiwa
Copy link
Member

dkayiwa commented Aug 28, 2017

why not?

@gayanW gayanW changed the title RESTWS-560 Create API Overview Docs RESTWS-560 Upgrade swagger-ui to 3.0.10 Aug 28, 2017
@gayanW
Copy link
Member Author

gayanW commented Aug 28, 2017

I was wondering if I could squash the commits without losing my local commit history?

@coveralls
Copy link

Coverage Status

Coverage remained the same at 40.023% when pulling 8a5d6b8 on gayanW:RESTWS-560 into 639ad02 on openmrs:master.

@dkayiwa
Copy link
Member

dkayiwa commented Aug 29, 2017

@gayanW are all these changes to do with upgrading swagger?

@gayanW
Copy link
Member Author

gayanW commented Aug 31, 2017

apiDocs.jsp is the only changed file. Others are swagger-ui distribution files. The old files are replaced with the new files.

});
window.onload = function() {
const ui = SwaggerUIBundle({
url: "${pageContext.request.contextPath}/module/webservices/rest/swagger.json",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this also part of the upgrade?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. The newer versions use SwaggerUIBundle instead of SwaggerUi.

<path d="M14.348 14.849c-.469.469-1.229.469-1.697 0L10 11.819l-2.651 3.029c-.469.469-1.229.469-1.697 0-.469-.469-.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-.469-.469-.469-1.228 0-1.697.469-.469 1.228-.469 1.697 0L10 8.183l2.651-3.031c.469-.469 1.228-.469 1.697 0 .469.469.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c.469.469.469 1.229 0 1.698z"/>
</symbol>

<symbol viewBox="0 0 20 20" id="large-arrow">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this also part of the upgrade?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No it is not part of the upgrade. It comes with swagger-ui dist as a sample. We have it before omod/src/main/webapp/resources/js/swagger-ui/index.html, so I include it.

source: "auth",
level: "warning",
message: "Authorization may be unsafe, passed state was changed in server Passed state wasn't returned from auth server"
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this also part of the upgrade?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No it's a sample as well.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have to include samples?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May be not. It has been included before. It is your call :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove the samples? That way the changes will be smaller and hence easier to review.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@gayanW gayanW changed the title RESTWS-560 Upgrade swagger-ui to 3.0.10 RESTWS-560 - Upgrade swagger-ui to 3.0.10 Sep 1, 2017
@coveralls
Copy link

Coverage Status

Coverage remained the same at 40.343% when pulling 868a6dd on gayanW:RESTWS-560 into d23b7dd on openmrs:master.

@dkayiwa dkayiwa merged commit 29da640 into openmrs:master Sep 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants