A small language that compiles to OpenAPI 3.1.0.
Responsible is based on KDL 1.0.0.
Once you've created your Responsible file, you can unlock all of the OpenAPI tooling:
bunx @responsibleapi/cli responsible.kdl -o /tmp/openapi.json
Below is some of the OpenAPI tooling provided by Responsible and third parties.
Use the built-in OpenAPI request validator.
brew install openapi-generator
openapi-generator generate -g typescript-fetch -i /tmp/openapi.json -o gen/ --additional-properties=typescriptThreePlus=true,modelPropertyNaming=original,nullSafeAdditionalProps=true,enumPropertyNaming=original,supportsES6=true,useSingleRequestParameter=false
openapi-generator generate -g kotlin -i /tmp/openapi.json -o gen/ --additional-properties=library=jvm-vertx
The idea behind testing with OpenAPI is validating server responses against the contract.
See https://github.com/responsibleapi/test-kotlin-vertx
To be published, see https://github.com/listenbox/yanic/blob/master/tests/responsible.py
bun install @responsibleapi/hono
const responsible = new Responsible<keyof Handlers, AppEnv>(
openApiInternal as oas31.OpenAPIObject,
hono,
)
test("signup", async () => {
await responsible.check("signup", {
req: {
body: {
name: genStr(),
email: genEmail(),
password: genStr(),
},
},
status: 201,
})
})
Use https://schemathesis.io for now
brew install uv
uvx schemathesis run --checks all --base-url http://localhost:8080 --workers 40 src/main/resources/openapi.json
Ultimately the plan is to integrate fuzzing into the testing libraries.