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

New schema validation module #128

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

nshweta90
Copy link
Contributor

No description provided.

@@ -0,0 +1,11 @@
package eu.europeana.api.commons;

public class JsonSchemaLoadingFailedException extends RuntimeException{
Copy link
Contributor

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 {
Copy link
Contributor

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 {
Copy link
Contributor

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
Copy link
Contributor

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 {
Copy link
Contributor

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 {
Copy link
Contributor

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

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.

2 participants