-
Notifications
You must be signed in to change notification settings - Fork 1
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
New schema validation module #128
base: master
Are you sure you want to change the base?
Conversation
@@ -0,0 +1,11 @@ | |||
package eu.europeana.api.commons; | |||
|
|||
public class JsonSchemaLoadingFailedException extends RuntimeException{ |
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.
should be moved to an exception package
@@ -0,0 +1,6 @@ | |||
package eu.europeana.api.commons; | |||
|
|||
public interface JsonSchemaLocation { |
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.
This class is not needed here.
JsonSchemaLocation interface only contains the classpath information which is used in the calling API and not here. JSON schema location will be specific for each API and will be present in the calling API not here.
import java.util.List; | ||
|
||
@Configuration | ||
public class JsonValidationConfiguration implements WebMvcConfigurer { |
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.
This class is not required in API-commons, it is to be added in the implementation/calling API where you want to inform the Spring about our JsonSchemaValidatingArgumentResolver.
public class JsonValidationConfiguration implements WebMvcConfigurer { | ||
|
||
|
||
@Autowired |
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.
this is a wrong spring injection by the way
import com.networknt.schema.ValidationMessage; | ||
import java.util.Set; | ||
|
||
public class JsonValidationFailedException extends RuntimeException { |
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.
move it to the exception package
import org.junit.jupiter.api.Test; | ||
|
||
|
||
class CommonsSchemavalidationApplicationTests { |
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.
this test class is doing nothing except context loading. Would be nice top add some tests or remove this
No description provided.