EOS project: json mandatory, optional schame difference

 


 {

            type: "object",

            properties: {

                name: { type: "string" },

                age: { type: "integer", minimum: 0 },

                email: { type: "string", format: "email" },

                address: {

                    type: "object",

                    properties: {

                        street: { type: "string" },

                        city: { type: "string" },

                        postalCode: { type: "string" }

                    },

                    required: ["street", "city", "postalCode"]

                }

            },

            required: ["name", "age", "email"]

        }

-------------------------------------------------------------------------

{

  type: "object",

  properties: {

    name: { type: "string" },

    age: { type: "integer", minimum: 0 },

    email: { type: "string", format: "email" },

    address: {

      type: "object",

      properties: {

        street: { type: "string" },

        city: { type: "string" },

        postalCode: { type: "string" }

      }

      // Removed the required array from address

    }

  }

  // Removed the required array from the main schema

}

Popular posts from this blog

pss book : శ్రీకృష్ణుడు దేవుడా, భగవంతుడా completed , second review needed. 26th April 2024

pss book: గురు ప్రార్థనామంజరి . completed 21st july 2024

pss book: కధల జ్ఞానము read review pending. 25th june 2024