Azure / typespec-azure

About TypeSpec Azure Libraries
https://azure.github.io/typespec-azure/
MIT License
15 stars 41 forks source link

x-ms-identifiers alternative #1473

Open timotheeguerin opened 2 months ago

timotheeguerin commented 2 months ago

Design approved

  1. Use @key whenever possible(including new multiple key feature added by microsoft/typespec
  2. If the default behavior is not suitable add a new decorator @identifiers
extern dec identifiers(target: ModelProperty, properties: ModelProperty[]);

function getModelIdentifiers(program: Program, model: Model): ModelProperty[];

decorator could potentially validate that the identifier specified are not the same as the default ones

markcowl commented 2 months ago

Proposal is here:https://gist.github.com/markcowl/d316ff4566aa04c5332c33402fbd218c