jackdelahunt / survey-json-schema

golang survey tooling to fullfill JSON schema requirements
Apache License 2.0
2 stars 1 forks source link

Allow users to pass reference to the object in the #4

Open wtrocki opened 2 years ago

wtrocki commented 2 years ago

API returns bytes[] which is too low level. We should change it so users can pass their own structures;

From

  resultBytes, err := options.GenerateValues(yourSchema, initialValues)
    if err != nil {
        return err
    }

To:

  resultBytes, err := options.GenerateValues(yourSchema,&yourObject, initialValues)
    if err != nil {
        return err
    }

Additionally we can see if we can make initialValues derived from the yourObject instance. For that we can use https://github.com/mitchellh/mapstructure