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

httpGet - pluck options out of GET response #127

Open
IckleChris opened this issue Nov 29, 2017 · 2 comments
Open

httpGet - pluck options out of GET response #127

IckleChris opened this issue Nov 29, 2017 · 2 comments

Comments

@IckleChris
Copy link

I have a need for a field that retrieves its options via an HTTP request (to an API). The structure of the response to that GET request is, for example;

{
    _embedded: {
        people: [
            // The array of options
        ]
    }
}

I found the optionsCallback option in the documentation however since the form schema (which is dynamic and provided by an API) could in theory contain infinite different API endpoint providers of options for different fields (with differing response keys in place of "people") creating a callback to pluck the options out is less feasible.

Is there a way to do something similar to the following? Thanks

"options": {
    "multiple": "true"
    "httpGet": {
        "url" : "http://my-api.com/people",
        "dataPath": "_embedded.people"
    }
}
@eighties8
Copy link

Wish someone had the answer for you after all this time. I have similar need but need angular (typescript) version of this library to be of use. Did you find a solution with another json schema library?

@nicklasb
Copy link
Member

nicklasb commented Mar 13, 2019

Sorry, I haven’t had any time for this library the last year, but I would love it if you added this funktionality(I welcome PRs). @bhamscott..angular version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants