Martin Berg Alstad 4fe388aca3 Config file with Port number.
Started implementing typespec for OpenAPI spec.
2024-06-07 14:37:47 +02:00

40 lines
635 B
Plaintext

import "@typespec/openapi3";
using TypeSpec.OpenAPI;
enum BinaryOperator {
AND,
OR,
IMPLICATION
}
model ExpressionNot {
not: Expression;
}
// TODO tuple type, possible in OpenAPI 3.1, but unsupported in typespec
model ExpressionBinary {
operator: BinaryOperator;
left: Expression;
right: Expression;
}
model ExpressionAtomic {
atomic: string;
}
@oneOf
union Expression {
ExpressionNot;
ExpressionBinary;
ExpressionAtomic;
}
model SimplifyResponse {
before: string;
after: string;
orderOfOperations: string[];
expression: Expression;
}
op simplify(): SimplifyResponse;