ManualRead for wrapping an API using attribute constraints

I want to wrap an API with a resource. The response from the provider has a bunch of fields that can be "", which I'd prefer to be nil. Pretty sure this can be handled with constraints on attributes when the values are casted. The example in the docs shows manually creating the resource's struct from the API response and using Ash.Query.apply_to/2-3. Will this approach apply the constraints for the returned values doing this? Or is there a better way to make sure the constraints are applied?
Solution:
I don't think it will cast those inputs, no
Jump to solution
3 Replies
Solution
ZachDaniel
ZachDaniel•4mo ago
I don't think it will cast those inputs, no
ZachDaniel
ZachDaniel•4mo ago
You will probably need to handle that manually
Chaz Watkins
Chaz WatkinsOP•4mo ago
Bummer. Recursive solution it is 🙂

Did you find this page helpful?