diff --git a/spec/main.tsp b/spec/main.tsp index 2bafe4a..39d300f 100644 --- a/spec/main.tsp +++ b/spec/main.tsp @@ -1,27 +1,38 @@ import "@typespec/http"; +import "@typespec/versioning"; import "./models.tsp"; using TypeSpec.Http; +using TypeSpec.Versioning; using Models; +enum Version { + v2 +} + +@versioned(Version) @service({ title: "Simplify Truth Expressions", + description: "Simplify truth expressions", }) namespace Simplify { model SimplifyResponse { - before: string; - after: string; - orderOfOperations?: string[] = []; - expression: Expression; -} + before: string; + after: string; + orderOfOperations?: string[] = []; + expression: Expression; + } -model SimplifyOptions { - lang: "en" | "nb" = "en"; - simplify: boolean = true; - caseSensitive: boolean = false; -} + model SimplifyOptions { + lang: "en" | "nb" = "en"; + simplify: boolean = true; + caseSensitive: boolean = false; + } -op simplify( - @path exp: string, - @query query?: SimplifyOptions -): SimplifyResponse; + @route("/simplify") + interface Simplify { + @get op simplify( + @path exp: string, + @query query?: SimplifyOptions + ): SimplifyResponse; + } } diff --git a/spec/tsp-output/@typespec/openapi3/openapi.yaml b/spec/tsp-output/@typespec/openapi3/openapi.v2.yaml similarity index 97% rename from spec/tsp-output/@typespec/openapi3/openapi.yaml rename to spec/tsp-output/@typespec/openapi3/openapi.v2.yaml index 7b878e1..0945dc2 100644 --- a/spec/tsp-output/@typespec/openapi3/openapi.yaml +++ b/spec/tsp-output/@typespec/openapi3/openapi.v2.yaml @@ -1,12 +1,12 @@ openapi: 3.0.0 info: title: Simplify Truth Expressions - version: 0.0.0 + version: v2 tags: [] paths: - /{exp}: + /simplify/{exp}: get: - operationId: simplify + operationId: Simplify_simplify parameters: - name: exp in: path