Pojo Not generating as per expectation for Extended Schema Definition using allOf

26 views
Skip to first unread message

Kulbhushan Azad

unread,
Sep 11, 2018, 5:11:19 PM9/11/18
to jsonschema2pojo-users
Hello All

i am trying to get a POJO class generated for an extended schema definition below also attached.
using jsonschema2pojo 0.5.1

I am expecting to get ShippingAddress class generated. However i am seeing it as getting generated as root Object rather than ShippingAddress

private Object shippingAddress;


Pls help to find out how can i get this

attaching both schema and generated class

{
    "definitions": {
        "address": {
            "type": "object",
            "properties": {
                "street_address": {
                    "type": "string"
                },
                "city": {
                    "type": "string"
                },
                "state": {
                    "type": "string"
                }
            },
            "required": [
                "street_address",
                "city",
                "state"
            ]
        }
    },
    "$schema": "http://json-schema.org/draft-07/schema#",
    "$id": "http://example.com/root.json",
    "type": "object",
    "title": "The Root Schema",
    "properties": {
        "shipping_address": {
            "allOf": [
                {
                    "$ref": "#/definitions/address"
                },
                {
                    "properties": {
                        "type": {
                            "enum": [
                                "residential",
                                "business"
                            ]
                        }
                    },
                    "required": [
                        "type"
                    ]
                }
            ]
        }
    }
}


Joe Littlejohn

unread,
Sep 11, 2018, 5:13:00 PM9/11/18
to jsonschema...@googlegroups.com
Hi

There's no support for allOf in this library.


--
You received this message because you are subscribed to the Google Groups "jsonschema2pojo-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jsonschema2pojo-...@googlegroups.com.
Visit this group at https://groups.google.com/group/jsonschema2pojo-users.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages