GithubHelp home page GithubHelp logo

janloebel / json-schema-validation-starter Goto Github PK

View Code? Open in Web Editor NEW
10.0 10.0 6.0 55 KB

Spring Boot 2 Starter for Json Schema Validation

License: MIT License

Java 100.00%
boot json jsonschema schema spring springboot starter validation

json-schema-validation-starter's People

Contributors

dependabot[bot] avatar janloebel avatar jochenberger avatar murygin avatar yasokada-lc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

json-schema-validation-starter's Issues

Application not loading due to lack of Bean

Receiving the message:

Consider defining a bean of type 'com.github.JanLoebel.jsonschemavalidation.provider.JsonSchemaProvider' in your configuration.

Application fails to start and basic context loading test fails.

Using @ComponentScan or @EntityScan pointing to the package doesn't fix the issue.

Using:

'org.springframework.boot' version '2.7.12'
'com.networknt:json-schema-validator:1.0.82'
'com.github.JanLoebel:json-schema-validation-starter:2.3.0'

Does not cover the object correctly when there are multiple refractions

Hi,

I have two sub relation and doesn't map from schema to object.

Schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "properties": {
        "data": {
            "type": "object",
            "properties": {
                "type": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "attributes": {
                    "type": "object",
                    "properties": {
                        "title": {
                            "type": "string"
                        }
                    },
                    "required": [
                        "title"
                    ]
                }
            },
            "required": [
                "type",
                "id"
            ]
        }
    },
    "required": [
        "data"
    ]
}

DTO

@JsonSchemaValidation("book.json")
public class BookDto {
    
    private String title;
    
    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }
}

Result:
{ "title": null }

Auto-Configuration does not work with Spring Boot 3

Auto-configuration must be done via META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports now.

Rather than a single comma-separate list, each line contains the fully qualified name of an auto-configuration class.

https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.7-Release-Notes#changes-to-auto-configuration
https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Migration-Guide#auto-configuration-files

Run tests on CI

Could you please setup simple GitHub CI task to run tests on each PR?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.