-
Notifications
You must be signed in to change notification settings - Fork 54
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
How do I filter the result of the parser? #42
Comments
The helper methods only operate against the request body (that is, the contents of |
I've been trying to use the mask method as it looks really useful but couldn't figure it out using the readme. Would it be difficult to allow the mask method to accept extra data? $parser->mask($mask, $data); Sorry if I'm way off the mark here, still loving this package without the mask! |
That is correct, yes. (Essentially. The "uploaded file" is actually the request body, but close enough.) One thing to note is that Laravel (via A second argument would probably work. There are other approaches that could work, too. Not sure which approach @nathanmac would prefer in this case, though, so it certainly warrants further conversation. |
I'm writing an API that calls an external API. The external API returns data as XML, and my API needs to return data as JSON. I have the following code that works fine
I then include this data into my JSON response like the following
This, as I said, works fine.
Now, however, I want to filter the XML response from the external API as I'm not interested in all the fields that it returns. I thought I could use the mask() method but I don't know how.
Since the methods are not fluent I thought I set the mask before parsing the payload, thinking that would apply the mask
But that doesn't work.
This is one reason I want to use this package, the ability to filter the output, but how to do it?
The text was updated successfully, but these errors were encountered: