sul-dlss / cocina-models

Cocina repository data model (implemented in Ruby)
https://sul-dlss.github.io/cocina-models/
3 stars 0 forks source link

Generate snake_case names in Rubyland (with backwards compat via generation + method_missing) #374

Closed mjgiarlo closed 2 years ago

mjgiarlo commented 2 years ago

Why was this change made? 🤔

This commit allows models to keep JavaScript naming conventions in JSland (using camelCase for JSON-based Cocina data structures, e.g., in OpenAPI specifications) and Ruby naming conventions in Rubyland (using snake_case for Ruby bindings, e.g., hashes and method calls).

Fixes #335

Includes:

How was this change tested? 🤨

CI

mjgiarlo commented 2 years ago

Superseded by https://github.com/sul-dlss/cocina-models/pull/375 (don't bother with metaprogramming, not needed).