bterlson / cadl-rdfs

A cadl to rdfs emitter
0 stars 0 forks source link

Implement Versioning #7

Open mspaulik opened 2 years ago

mspaulik commented 2 years ago

If a CADL model has a version then that should be handled by the CADL emitter to RDF.

This task should be implemented after the namespaces are supported.

To add versioning to the project you first need to install the package: npm install @cadl-lang/versioning --save

Once you've done that you can import it in your CADL file.

import "@cadl-lang/versioning"

using Cadl.Versioning;

@versioned(Versions) 
namespace mynamespace {

     model Person {
            @added (Versions.v2) name: string;
            @added (Versions.v3) age: numeric;
     }
}
enum Versions {
     "v1",
     "v2",
     "v3",
}
mspaulik commented 2 years ago

Do after ENUMS are done.