Title: Translate between camelCase JSON fields to snake_case python model values · Issue #27 · anomaly/lab-python-server · GitHub
Open Graph Title: Translate between camelCase JSON fields to snake_case python model values · Issue #27 · anomaly/lab-python-server
X Title: Translate between camelCase JSON fields to snake_case python model values · Issue #27 · anomaly/lab-python-server
Description: Javascript convention is to have camelCase values for JSON payloads while PEP-8 requires us to have snake_case, luckily we can use pydantic configurations to automatically achieve this. See this article It does depend on humps which is n...
Open Graph Description: Javascript convention is to have camelCase values for JSON payloads while PEP-8 requires us to have snake_case, luckily we can use pydantic configurations to automatically achieve this. See this ar...
X Description: Javascript convention is to have camelCase values for JSON payloads while PEP-8 requires us to have snake_case, luckily we can use pydantic configurations to automatically achieve this. See this ar...
Opengraph URL: https://github.com/anomaly/lab-python-server/issues/27
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Translate between camelCase JSON fields to snake_case python model values","articleBody":"Javascript convention is to have `camelCase` values for `JSON` payloads while `PEP-8` requires us to have `snake_case`, luckily we can use `pydantic` configurations to automatically achieve this.\r\n\r\n[See this article](https://medium.com/analytics-vidhya/camel-case-models-with-fast-api-and-pydantic-5a8acb6c0eee)\r\n\r\nIt does depend on [humps](https://humps.readthedocs.io/en/latest/) which is not the end of the world.\r\n\r\nAn example from a project we have used it in:\r\n```python\r\nclass FacilityResponse(IdentityMixin,\r\n DateTimeMixin, FacilityPayload):\r\n \"\"\" A facilitiy managed by the organisation\r\n \"\"\"\r\n\r\n class Config:\r\n orm_mode = True\r\n alias_generator = to_camel_case\r\n allow_population_by_field_name = True\r\n```","author":{"url":"https://github.com/devraj","@type":"Person","name":"devraj"},"datePublished":"2022-08-02T05:26:12Z","url":"https://github.com/anomaly/lab-python-server/issues/27"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| 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:b8137bb4-49d2-1f3e-5c80-b6cfe15acf5a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E698:E0F3D:6A0392:8DE26C:6B04A891 |
| html-safe-nonce | d7f695b77bbfc74cfb61850a4a9da35c879e32ac35ba8097ce33dcfddf6f45a6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNjk4OkUwRjNEOjZBMDM5Mjo4REUyNkM6NkIwNEE4OTEiLCJ2aXNpdG9yX2lkIjoiNzExNjk1OTU3Mzc2Mzk5MTY5NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 31b0b19d9590bc135b7bba4f6bbaa5ae8a4caad23e379f21786451bcda468300 |
| hovercard-subject-tag | issue:1325304950 |
| 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/anomaly/lab-python-server/27/issue_layout |
| twitter:image | https://opengraph.githubassets.com/dce2870d4adc9300ccbb8ca1ba69f48b1ac23c61e59df4606eaadfad8ab16be7/anomaly/lab-python-server/issues/27 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/dce2870d4adc9300ccbb8ca1ba69f48b1ac23c61e59df4606eaadfad8ab16be7/anomaly/lab-python-server/issues/27 |
| og:image:alt | Javascript convention is to have camelCase values for JSON payloads while PEP-8 requires us to have snake_case, luckily we can use pydantic configurations to automatically achieve this. See this ar... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | devraj |
| hostname | github.com |
| expected-hostname | github.com |
| None | 188497a0f45a7aa8f7c866faa1950d1a7f8d82b59416adf549b222ad1d1dd19b |
| turbo-cache-control | no-preview |
| go-import | github.com/anomaly/lab-python-server git https://github.com/anomaly/lab-python-server.git |
| octolytics-dimension-user_id | 3654837 |
| octolytics-dimension-user_login | anomaly |
| octolytics-dimension-repository_id | 491764445 |
| octolytics-dimension-repository_nwo | anomaly/lab-python-server |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 491764445 |
| octolytics-dimension-repository_network_root_nwo | anomaly/lab-python-server |
| 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 | 557cfbac6cdb532730c95c90f2cefdc0c4128029 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width