Skip to main content

vulkro openapi

Generates an OpenAPI 3.1 specification from the endpoints Vulkro finds in your code.

vulkro openapi . # JSON to stdout
vulkro openapi . --format yaml -o spec.yaml

Flags​

FlagDescription
--format <FORMAT>json (default) or yaml.
-o, --output <FILE>Write to a file instead of stdout.
--project-name <NAME>Set info.title.
--project-version <VER>Set info.version.

What you get​

  • One operation per path and method. HEAD, OPTIONS and ANY are skipped.
  • Path parameters as in: path strings. Types are not inferred.
  • A 200 response on every operation.
  • security: [{ bearerAuth: [] }] on protected endpoints.
  • Extensions from the auth model: x-vulkro-tier, x-vulkro-scopes, x-vulkro-tenant-scoped.
paths:
/users/{id}:
get:
operationId: users_show_get
parameters:
- { name: id, in: path, required: true, schema: { type: string } }
responses:
'200': { description: Success }
security:
- bearerAuth: []
x-vulkro-tier: user

Exit codes​

0 spec written. 2 scan or IO error.

See also: vulkro discover, vulkro rbac.