Skip to content
This repository was archived by the owner on Mar 13, 2024. It is now read-only.
This repository was archived by the owner on Mar 13, 2024. It is now read-only.

model-util: Add support for generating example data for Primitive Schema #24

@nbhusare

Description

@nbhusare

Expected Behaviour

You should get the example data if you input a Primitive Schema to the Model Utility.
For example - {"type":"integer"}. The expected result here is an integer value.

Actual Behaviour

The utility fails with an NPE.

The method loadModelString in ModelObject does not take into consideration Primitive types schema's. It makes a hard assumption about the existence of the following fields - items, properties, required...

Sample Code that illustrates the problem

val schema = {"type":"integer"};
new ModelObject(schema, false);

Platform and Version

1.0.4

Logs taken while reproducing the problem

java.lang.NullPointerException
	at com.adobe.ride.utilities.model.ModelObject.loadModelString(ModelObject.java:101)
	at com.adobe.ride.utilities.model.ModelObject.<init>(ModelObject.java:285)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions