76 lines
1.4 KiB
Plaintext
Raw Permalink Normal View History

2024-06-07 16:27:52 +02:00
import "@typespec/http";
2024-06-07 16:38:06 +02:00
import "@typespec/versioning";
2024-06-07 16:27:52 +02:00
import "./models.tsp";
import "./response.tsp";
import "./options.tsp";
2024-06-07 16:27:52 +02:00
using TypeSpec.Http;
2024-06-07 16:38:06 +02:00
using TypeSpec.Versioning;
2024-06-07 16:27:52 +02:00
using Models;
using Responses;
using Options;
/**
* A service to simplify truth expressions, and generate truth tables.
*/
@service({
title: "Simplify Truth API",
})
@versioned(Version)
namespace SimplifyTruths;
2024-06-07 16:38:06 +02:00
enum Version {
v2,
2024-06-07 16:38:06 +02:00
}
@tag("Common")
interface Index {
/**
* Information about this API.
*/
@get
@summary("Information")
index(): InfoResponse;
/**
* The OpenAPI specification for this API.
*/
@get
@route("/openapi")
@summary("The OpenAPI specification")
openAPI(): HTML;
/**
* Check if an expression is valid.
*/
@get
@tag("Expression")
@route("/is-valid")
@summary("Check if an expression is valid")
isValid(@path exp: string): IsValidResponse;
}
@tag("Expression")
@route("/simplify")
interface Simplify {
@get
@summary("Simplify a truth expression")
simplify(@path exp: string, @query query?: SimplifyOptions): SimplifyResponse;
@get
@tag("Table")
@route("/table")
@summary("Simplify and generate a truth table")
simplifyTable(
@path exp: string,
@query query?: SimplifyTableOptions,
): SimplifyTableResponse;
}
@tag("Table")
@route("/table")
interface TruthTable {
@get
@summary("Generate a truth table")
simplify(@path exp: string, @query query?: TableOptions): TruthTableResponse;
2024-06-07 16:27:52 +02:00
}