Title: Support for Attributes? · Issue #48 · fable-compiler/Fable.Python · GitHub
Open Graph Title: Support for Attributes? · Issue #48 · fable-compiler/Fable.Python
X Title: Support for Attributes? · Issue #48 · fable-compiler/Fable.Python
Description: I'm now happy with Fable's reflection, which allows me to do what pydantic does in the python world. However I want to step further. I want to allow syntax sugars in the configuration, but get the same syntax tree. type github_url= { url...
Open Graph Description: I'm now happy with Fable's reflection, which allows me to do what pydantic does in the python world. However I want to step further. I want to allow syntax sugars in the configuration, but get the ...
X Description: I'm now happy with Fable's reflection, which allows me to do what pydantic does in the python world. However I want to step further. I want to allow syntax sugars in the configuration, but ...
Opengraph URL: https://github.com/fable-compiler/Fable.Python/issues/48
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Support for Attributes?","articleBody":"I'm now happy with Fable's reflection, which allows me to do what [pydantic](https://github.com/samuelcolvin/pydantic) does in the python world.\r\n\r\nHowever I want to step further. I want to allow syntax sugars in the configuration, but get the same syntax tree.\r\n\r\n```F#\r\ntype github_url= { url: string; [\u003cDefault(\"main\")\u003e] branch: string}\r\n\r\ntype myconfig = \r\n{\r\n [\u003cAllowSingular\u003e] author: string array\r\n url : github_url\r\n ...\r\n}\r\n```\r\n\r\nBy using attributes, I want to control JSON deserialization, to parse into the same results for\r\n\r\n```json\r\n{\r\n \"author\" : [\"fable\"],\r\n \"url\" : { \"name\": \"xxx/xxx\", \"branch\", \"main\" },\r\n ...\r\n}\r\n```\r\n\r\nand \r\n\r\n\r\n```json\r\n{ \r\n \"author\": \"fable\",\r\n \"url\": \"xxx/xxx\"\r\n}\r\n```\r\n\r\nIs the use of attributes possible in Fable?","author":{"url":"https://github.com/thautwarm","@type":"Person","name":"thautwarm"},"datePublished":"2022-01-16T03:46:15.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/48/Fable.Python/issues/48"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:c0f17ac0-d09b-2f30-440f-c2f444efbbca |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AC22:589DD:4812A:665AC:69789FE8 |
| html-safe-nonce | ad579a4495d642fc5c10362957f3821c4af031227d3014334a133fcf4276cd17 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQzIyOjU4OUREOjQ4MTJBOjY2NUFDOjY5Nzg5RkU4IiwidmlzaXRvcl9pZCI6IjQwNzExMjQxMzc4NTY3NzAwMjQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | a73b8ecac79d49fced199a1a7ddcc00d79a1204cbe02e296d925292e4634bd0a |
| hovercard-subject-tag | issue:1104943577 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/fable-compiler/Fable.Python/48/issue_layout |
| twitter:image | https://opengraph.githubassets.com/21530d7193d4ec19472bbaae1b7f73e8a744d827d712cda4973f27623e5246bb/fable-compiler/Fable.Python/issues/48 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/21530d7193d4ec19472bbaae1b7f73e8a744d827d712cda4973f27623e5246bb/fable-compiler/Fable.Python/issues/48 |
| og:image:alt | I'm now happy with Fable's reflection, which allows me to do what pydantic does in the python world. However I want to step further. I want to allow syntax sugars in the configuration, but get the ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | thautwarm |
| hostname | github.com |
| expected-hostname | github.com |
| None | 2981c597c945c1d90ac6fa355ce7929b2f413dfe7872ca5c435ee53a24a1de50 |
| turbo-cache-control | no-preview |
| go-import | github.com/fable-compiler/Fable.Python git https://github.com/fable-compiler/Fable.Python.git |
| octolytics-dimension-user_id | 21062526 |
| octolytics-dimension-user_login | fable-compiler |
| octolytics-dimension-repository_id | 398501421 |
| octolytics-dimension-repository_nwo | fable-compiler/Fable.Python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 398501421 |
| octolytics-dimension-repository_network_root_nwo | fable-compiler/Fable.Python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f8aa86d87c47054170094daaf9699b27a28a8448 |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width