Updated tsp

This commit is contained in:
Martin Berg Alstad 2024-06-07 16:38:06 +02:00
parent b16a4eefe4
commit 912cf6f1e5
2 changed files with 28 additions and 17 deletions

View File

@ -1,27 +1,38 @@
import "@typespec/http"; import "@typespec/http";
import "@typespec/versioning";
import "./models.tsp"; import "./models.tsp";
using TypeSpec.Http; using TypeSpec.Http;
using TypeSpec.Versioning;
using Models; using Models;
enum Version {
v2
}
@versioned(Version)
@service({ @service({
title: "Simplify Truth Expressions", title: "Simplify Truth Expressions",
description: "Simplify truth expressions",
}) })
namespace Simplify { namespace Simplify {
model SimplifyResponse { model SimplifyResponse {
before: string; before: string;
after: string; after: string;
orderOfOperations?: string[] = []; orderOfOperations?: string[] = [];
expression: Expression; expression: Expression;
} }
model SimplifyOptions { model SimplifyOptions {
lang: "en" | "nb" = "en"; lang: "en" | "nb" = "en";
simplify: boolean = true; simplify: boolean = true;
caseSensitive: boolean = false; caseSensitive: boolean = false;
} }
op simplify( @route("/simplify")
@path exp: string, interface Simplify {
@query query?: SimplifyOptions @get op simplify(
): SimplifyResponse; @path exp: string,
@query query?: SimplifyOptions
): SimplifyResponse;
}
} }

View File

@ -1,12 +1,12 @@
openapi: 3.0.0 openapi: 3.0.0
info: info:
title: Simplify Truth Expressions title: Simplify Truth Expressions
version: 0.0.0 version: v2
tags: [] tags: []
paths: paths:
/{exp}: /simplify/{exp}:
get: get:
operationId: simplify operationId: Simplify_simplify
parameters: parameters:
- name: exp - name: exp
in: path in: path