-
Notifications
You must be signed in to change notification settings - Fork 521
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-958: Upgrade swagger to 2.2.23 #631
base: master
Are you sure you want to change the base?
Conversation
e47142d
to
672ccc1
Compare
@@ -19,6 +19,28 @@ | |||
<groupId>${project.parent.groupId}</groupId> | |||
<artifactId>${project.parent.artifactId}-omod-common</artifactId> | |||
<version>${project.parent.version}</version> | |||
<exclusions> | |||
<exclusion> | |||
<groupId>com.fasterxml.jackson.core</groupId> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hacky but i needed to add these exclusions because the jackson related dependencies coming from swagger-core 2.2.23 are quite high and causing conflicts with the related jackson stuff from spring
<exclusions> | ||
<exclusion> | ||
<groupId>com.fasterxml.jackson.core</groupId> | ||
<artifactId>jackson-annotations</artifactId> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
@@ -21,6 +21,28 @@ | |||
<groupId>${project.parent.groupId}</groupId> | |||
<artifactId>${project.parent.artifactId}-omod-common</artifactId> | |||
<version>${project.parent.version}</version> | |||
<exclusions> | |||
<exclusion> | |||
<groupId>com.fasterxml.jackson.core</groupId> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
@@ -23,6 +23,28 @@ | |||
<groupId>${project.parent.groupId}</groupId> | |||
<artifactId>${project.parent.artifactId}-omod-common</artifactId> | |||
<version>${project.parent.version}</version> | |||
<exclusions> | |||
<exclusion> | |||
<groupId>com.fasterxml.jackson.core</groupId> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
@mherman22 Rather than doing the exclusions in every POM, can we add the exclusion to the |
@ibacher i tried that before this approach however this bean here -> Line 39 in 61a27fa
org.springframework.beans.factory.BeanDefinitionStoreException with something as
for more context -> https://paste.ubuntu.com/p/tJ6mZxnKJJ/ |
I see what you mean... Have you tried running this version in an SDK instance? |
Version you mean the omod built with the changes of this PR? If so, then no. I have an instance I setup using docker but then openmrs is failing on startup for example the queue module's 1xlegacyController class is the cause and its because i think I need to now go into each of those modules and update them to take up stuff in this PR. However I can not do before we have this in. Or is there a way I can actually test this on modules without having to first get this in? |
Technically, if you run |
|
Interesting, thanks. If I can test this locally then that's great. I will update the PR as and when I have tested thoroughly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pulled this out of RestConstants because for soe reason, initialization of RestConstants was failing.
|
||
openAPI = new OpenAPI(); | ||
BuildJSON(); | ||
cachedJson = createJSON(); // Cache the JSON string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Spec was being reset when accessing cached data, causing
empty paths in the API documentation on subsequent requests. This occurred
because initOpenAPI()
was creating a new empty Paths object while handling
cached responses.
@@ -31,9 +31,9 @@ | |||
</dependency> | |||
|
|||
<dependency> | |||
<groupId>io.swagger</groupId> | |||
<groupId>io.swagger.core.v3</groupId> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quick thing: since the versions are already defined in the root POM (in dependency management), they don't need to be specified here. That way we only need to update versions in a single place (dependency management doesn't make something a dependency, but it's configuration applies to a dependency with the same coordinates.
For the same reasons, we shouldn't need to replicate the exclusions here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
…eModule cannot be cast to com.fasterxml.jackson.databind.Module
…eModule cannot be cast to com.fasterxml.jackson.databind.Module
…alongside openmrs-core
9b0b984
to
c59f9e0
Compare
@mherman22 as we discussed on this week's platform call, did you get some time to check if swagger has an option that saves us from the burden of having to manually maintain resource documentation? |
@dkayiwa I am still looking into that. But so far what i have landed on from the various docs that i have read indicate OpenAPI 3.0 itself may not provide a mechanism to automatically generate schema definitions from code. But i am looking into Springdoc trying to see if it works for us but it looks to be more of a springboot project. Others that i have looked at are poorly maintained and it's been long (4 years) since the last commit. I will take any suggestions before i read all books on the internet 😃 |
add springfox to that list. |
Description of what I changed
Issue I worked on
see https://issues.openmrs.org/browse/RESTWS-958
Checklist: I completed these to help reviewers :)
My IDE is configured to follow the code style of this project.
No? Unsure? -> configure your IDE, format the code and add the changes with
git add . && git commit --amend
I have added tests to cover my changes. (If you refactored
existing code that was well tested you do not have to add tests)
No? -> write tests and add them to this commit
git add . && git commit --amend
I ran
mvn clean package
right before creating this pull request andadded all formatting changes to my commit.
No? -> execute above command
All new and existing tests passed.
No? -> figure out why and add the fix to your commit. It is your responsibility to make sure your code works.
My pull request is based on the latest changes of the master branch.
No? Unsure? -> execute command
git pull --rebase upstream master