Skip to content

Implement OpenAPI 3.0 specification using cl-sdk/cl-json#2

Merged
diasbruno merged 3 commits into
mainfrom
copilot/implement-openapi-specification
May 4, 2026
Merged

Implement OpenAPI 3.0 specification using cl-sdk/cl-json#2
diasbruno merged 3 commits into
mainfrom
copilot/implement-openapi-specification

Conversation

Copilot AI commented May 4, 2026

Copy link
Copy Markdown
Contributor

Bootstraps cl-openapi from a stub package into a full OpenAPI 3.0 document parser backed by cl-sdk/cl-json.

Core implementation

  • types.lisp — CLOS classes for all 24 OAS 3.0 objects: openapi-document, info, contact, license, server, server-variable, path-item, operation, parameter, header, request-body, media-type, encoding, response, example, link, tag, schema, discriminator, xml, security-scheme, oauth-flows, oauth-flow, reference
  • decode.lispjson:decode-json specializations for each type; $ref objects decode to reference instances transparently. Top-level entry point: cl-openapi:parse
  • package.lisp — exports ~120 symbols covering all types and their accessors

Usage

(let* ((doc (cl-openapi:parse "{\"openapi\":\"3.0.0\",\"info\":{\"title\":\"Pets\",\"version\":\"1.0\"},\"paths\":{\"/pets\":{\"get\":{\"operationId\":\"listPets\",\"responses\":{\"200\":{\"description\":\"OK\"}}}}}}"))
       (op  (cl-openapi:path-item-get (gethash "/pets" (cl-openapi:openapi-paths doc)))))
  (cl-openapi:operation-id op))  ; => "listPets"

$ref pointers decode to reference instances; callers resolve them against components as needed.

Infrastructure

  • qlfile — declares cl-sdk/cl-json and cl-sdk/meta-definitions as qlot GitHub dependencies (neither is in the standard Quicklisp dist)
  • CI — updated run step to qlot exec ros run -- so qlot-managed packages are on the load path
  • Tests — 14 FiveAM tests covering document structure, schemas, $ref, composition (allOf/anyOf/oneOf), components, and responses

Copilot AI and others added 2 commits May 4, 2026 00:17
@diasbruno diasbruno marked this pull request as ready for review May 4, 2026 00:28
@diasbruno diasbruno force-pushed the copilot/implement-openapi-specification branch 11 times, most recently from b32b156 to 00b6341 Compare May 4, 2026 02:54
@diasbruno diasbruno force-pushed the copilot/implement-openapi-specification branch from 00b6341 to 9eddb86 Compare May 4, 2026 02:57
@diasbruno diasbruno merged commit d2130e9 into main May 4, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants