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

Attributes & reflection magic #71

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Attributes & reflection magic #71

wants to merge 3 commits into from

Conversation

lighe
Copy link
Contributor

@lighe lighe commented Oct 18, 2024

  • Add Field attribute to map an entity property to the array/json key
    • #[Field] maps to the snake cased array key
    • #[Field('name') maps to the name key
    • #[Field('my.nested.field') maps to a nested array: ["my"=>["nested"=>["field" => value]]]
  • Automatically cast values to the correct types based on the property's type
  • Add ArrayShape(Type) attribute to help cast property array members

@lighe lighe changed the title Feature/attributes Attributes & reflection magic Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant