Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

example of how to handle a non-standard payload #24

Open
nealwp opened this issue Mar 18, 2023 · 0 comments
Open

example of how to handle a non-standard payload #24

nealwp opened this issue Mar 18, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@nealwp
Copy link
Owner

nealwp commented Mar 18, 2023

Generally, we might expect a JSON payload that nicely maps to our model, like this:

{
    prop1: "foo",
    prop2: "bar",
    prop3: "baz",
    array1: [thing1, ...],
    array2: [thing1, ...]
}

where we have columns that map to scalar values, and arrays that map to @HasMany(), foreign keys, etc. But what if our incoming payload looked like this, while our model structure stays the same:

{
    mainProp: {
        prop1: "foo",
        prop2: "bar",
        prop3: "baz",
    },
    array1: [thing1, ...],
    array2: [thing1, ...]
}

Add an example model that can deal with this.

@nealwp nealwp added the enhancement New feature or request label Mar 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant