Forum Discussion

pfh's avatar
pfh
New Contributor
3 months ago

Problems with Generating model from JSON

I'm having a hard time getting Stoplight to correctly process the josn I supply to generate a model.

Here's a simple example with just one field.

{"ConcertID":{"type":"integer","format":"int32"}

When I generate the model form this, I get what is in the attached screenshot.which basically ignores my json for the type and format and classifies them all as strings.

I'm obviously doing something wrong, hoping someone can educate me on the correct format.

1 Reply

  • I believe you want to use an example of your JSON object, like:

    {"ConcertID":235}.

    Stoplight will infer the type and create your model correctly.