metarhia / metaschema

Schema definition and validation 💡
https://metarhia.com
MIT License
52 stars 18 forks source link

Concatenate schemas with fields or other schemas #397

Open georgolden opened 2 years ago

georgolden commented 2 years ago

@lundibundi please edit

Is your feature request related to a problem? Please describe.

A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like

User { name: 'string' } => User { name: 'string', age: 'number', fullName: 'string' }

Describe alternatives you've considered

A clear and concise description of any alternative solutions or features you've considered.

Additional context

Add any other context or screenshots about the feature request here.

georgolden commented 2 years ago

@lundibundi I think it is better to create another schema rather then mixin into existing one. What do you think?

And how to deal with conflicts if 2 schemas have same field with different type? Error throw?

georgolden commented 2 years ago
  1. create a fork of this repo
  2. use npm ci to install deps
  3. create a branch named feature/concat-schemas
  4. create a test for a this feature

Requirements.

dmitryt commented 2 years ago

I'd like to take this one