starting new job...
→ running command: cd "/etc/byggsteg/job-clone//guile-openapi-generator/trunk" && git reset --hard && git pull
HEAD is now at 97f93f9 feat: Improve generator implementation
From https://codeberg.org/jjba23/guile-openapi-generator
97f93f9..a5a7efc trunk -> origin/trunk
* [new tag] v0.0.2 -> v0.0.2
Updating 97f93f9..a5a7efc
Fast-forward
README.org | 44 +++++++
src/openapi-generator/cli.scm | 189 ++++++++++++++++++++++++++----
src/openapi-generator/client.scm | 41 ++++---
src/openapi-generator/config-file.scm | 177 +++++++++++++++++++++++++++++
src/openapi-generator/config.scm | 25 +++-
src/openapi-generator/controllers.scm | 62 +++++-----
src/openapi-generator/generator.scm | 99 +++++++++++++---
src/openapi-generator/models.scm | 54 +++++----
src/openapi-generator/naming.scm | 62 ++++++++++
src/openapi-generator/schema.scm | 51 ++++++---
src/openapi-generator/spec.scm | 27 +++--
test/fixtures/config/generator.json | 8 ++
test/fixtures/config/generator.yaml | 13 +++
test/fixtures/config/header.txt | 2 +
test/openapi-support.scm | 12 +-
test/veritas/unit/generator-spec.scm | 208 +++++++++++++++++++++++++++++++++-
16 files changed, 938 insertions(+), 136 deletions(-)
create mode 100644 src/openapi-generator/config-file.scm
create mode 100644 test/fixtures/config/generator.json
create mode 100644 test/fixtures/config/generator.yaml
create mode 100644 test/fixtures/config/header.txt
→ running command: cd /etc/byggsteg/job-clone/guile-openapi-generator/trunk && uname -a
Linux wolk-jjba 7.1.5-gnu #1 SMP PREEMPT_DYNAMIC 1 x86_64 GNU/Linux
→ running command: cd /etc/byggsteg/job-clone/guile-openapi-generator/trunk && git log --name-status HEAD^..HEAD
commit a5a7efce1e9c2d42cf06c62c97a64405721eed4b
Author: Josep Bigorra <jjbigorra@gmail.com>
Date: Thu Oct 22 09:24:01 2026 +0200
feat: Implement config options
M README.org
M src/openapi-generator/cli.scm
M src/openapi-generator/client.scm
A src/openapi-generator/config-file.scm
M src/openapi-generator/config.scm
M src/openapi-generator/controllers.scm
M src/openapi-generator/generator.scm
M src/openapi-generator/models.scm
M src/openapi-generator/naming.scm
M src/openapi-generator/schema.scm
M src/openapi-generator/spec.scm
A test/fixtures/config/generator.json
A test/fixtures/config/generator.yaml
A test/fixtures/config/header.txt
M test/openapi-support.scm
M test/veritas/unit/generator-spec.scm
→ running command: cd /etc/byggsteg/job-clone/guile-openapi-generator/trunk && maak test
;;; note: source file ./src/openapi-generator/client.scm
;;; newer than compiled /tmp/.cache/guile/ccache/3.0-LE-8-4.7/etc/byggsteg/job-clone/guile-openapi-generator/trunk/src/openapi-generator/client.scm.go
;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
;;; or pass the --no-auto-compile argument to disable.
;;; compiling ./src/openapi-generator/client.scm
;;; note: source file ./src/openapi-generator/naming.scm
;;; newer than compiled /tmp/.cache/guile/ccache/3.0-LE-8-4.7/etc/byggsteg/job-clone/guile-openapi-generator/trunk/src/openapi-generator/naming.scm.go
;;; compiling ./src/openapi-generator/naming.scm
;;; compiled /tmp/.cache/guile/ccache/3.0-LE-8-4.7/etc/byggsteg/job-clone/guile-openapi-generator/trunk/src/openapi-generator/naming.scm.go
;;; note: source file ./src/openapi-generator/spec.scm
;;; newer than compiled /tmp/.cache/guile/ccache/3.0-LE-8-4.7/etc/byggsteg/job-clone/guile-openapi-generator/trunk/src/openapi-generator/spec.scm.go
;;; compiling ./src/openapi-generator/spec.scm
;;; compiled /tmp/.cache/guile/ccache/3.0-LE-8-4.7/etc/byggsteg/job-clone/guile-openapi-generator/trunk/src/openapi-generator/spec.scm.go
;;; note: source file ./src/openapi-generator/schema.scm
;;; newer than compiled /tmp/.cache/guile/ccache/3.0-LE-8-4.7/etc/byggsteg/job-clone/guile-openapi-generator/trunk/src/openapi-generator/schema.scm.go
;;; compiling ./src/openapi-generator/schema.scm
;;; compiled /tmp/.cache/guile/ccache/3.0-LE-8-4.7/etc/byggsteg/job-clone/guile-openapi-generator/trunk/src/openapi-generator/schema.scm.go
;;; note: source file ./src/openapi-generator/models.scm
;;; newer than compiled /tmp/.cache/guile/ccache/3.0-LE-8-4.7/etc/byggsteg/job-clone/guile-openapi-generator/trunk/src/openapi-generator/models.scm.go
;;; compiling ./src/openapi-generator/models.scm
;;; note: source file ./src/openapi-generator/config.scm
;;; newer than compiled /tmp/.cache/guile/ccache/3.0-LE-8-4.7/etc/byggsteg/job-clone/guile-openapi-generator/trunk/src/openapi-generator/config.scm.go
;;; compiling ./src/openapi-generator/config.scm
;;; compiled /tmp/.cache/guile/ccache/3.0-LE-8-4.7/etc/byggsteg/job-clone/guile-openapi-generator/trunk/src/openapi-generator/config.scm.go
;;; compiled /tmp/.cache/guile/ccache/3.0-LE-8-4.7/etc/byggsteg/job-clone/guile-openapi-generator/trunk/src/openapi-generator/models.scm.go
;;; compiled /tmp/.cache/guile/ccache/3.0-LE-8-4.7/etc/byggsteg/job-clone/guile-openapi-generator/trunk/src/openapi-generator/client.scm.go
;;; note: source file ./test/openapi-support.scm
;;; newer than compiled /tmp/.cache/guile/ccache/3.0-LE-8-4.7/etc/byggsteg/job-clone/guile-openapi-generator/trunk/test/openapi-support.scm.go
;;; compiling ./test/openapi-support.scm
;;; note: source file ./src/openapi-generator/generator.scm
;;; newer than compiled /tmp/.cache/guile/ccache/3.0-LE-8-4.7/etc/byggsteg/job-clone/guile-openapi-generator/trunk/src/openapi-generator/generator.scm.go
;;; compiling ./src/openapi-generator/generator.scm
;;; note: source file ./src/openapi-generator/controllers.scm
;;; newer than compiled /tmp/.cache/guile/ccache/3.0-LE-8-4.7/etc/byggsteg/job-clone/guile-openapi-generator/trunk/src/openapi-generator/controllers.scm.go
;;; compiling ./src/openapi-generator/controllers.scm
;;; openapi-generator/controllers.scm:161:8: warning: non-literal format string
;;; openapi-generator/controllers.scm:226:3: warning: non-literal format string
;;; openapi-generator/controllers.scm:327:14: warning: non-literal format string
;;; openapi-generator/controllers.scm:376:17: warning: non-literal format string
;;; openapi-generator/controllers.scm:486:17: warning: non-literal format string
;;; compiled /tmp/.cache/guile/ccache/3.0-LE-8-4.7/etc/byggsteg/job-clone/guile-openapi-generator/trunk/src/openapi-generator/controllers.scm.go
;;; openapi-generator/generator.scm:410:9: warning: non-literal format string
;;; compiled /tmp/.cache/guile/ccache/3.0-LE-8-4.7/etc/byggsteg/job-clone/guile-openapi-generator/trunk/src/openapi-generator/generator.scm.go
scanning directories for unit tests...
scanning present working directory for unit tests...
shuffled the files with seed 880455787 (replay with VERITAS_SEED=880455787)
found unit tests: (client-spec.scm spec-spec.scm models-spec.scm controllers-spec.scm integration-spec.scm reader-spec.scm generator-spec.scm runtime-spec.scm schema-spec.scm code-spec.scm naming-spec.scm jso-spec.scm yaml-spec.scm)
running unit tests from file: client-spec.scm, entrypoint: spec
ℹ️ info - shuffled with seed 880455787 (replay with VERITAS_SEED=880455787)
+----------------------------------------------+
[📑 suite] Generated client against a server
[🧪 test] An undeclared status raises instead of decoding
✅ got: (500)
[🧪 test] The client talks to the server: query, credentials, JSON out and back
✅ got: (200 (Rex Bella) Mia 201 Cadet 204)
[⚙️ assert] the server answered a GET /pets
✅ got: #t
[⚙️ assert] the server answered a POST /pets
✅ got: #t
✅ got: secret
✅ got: limit=10
✅ got: {"name":"Cadet"}
+----------------------------------------------+
[📑 suite] Generated text
[🧪 test] The libcurl client uses guile-curl
✅ got: #t
✅ got: #t
✅ got: #t
✅ got: #t
✅ got: #t
✅ got: #f
[🧪 test] The plain Guile client uses (web client)
✅ got: #t
✅ got: #t
✅ got: #t
✅ got: #f
[🧪 test] Every operation is a procedure
[⚙️ assert] four operations, the constructor and the transport
✅ got: 6
✅ got: #t
✅ got: #t
✅ got: #t
[🧪 test] An operation authenticates before it sends
✅ got: #t
[⚙️ assert] the public operation asks for no credentials
✅ got: #t
[🧪 test] A client is a record with a base URL and credentials
✅ got: #t
✅ got: #t
[⚙️ assert] the first server of the specification is used
✅ got: #t
[🧪 test] The security schemes are a literal
✅ got: #t
✅ got: #t
✅ got: #t
ℹ️ info - ran 2 tasks in: 2 seconds, -249292 microseconds
running unit tests from file: spec-spec.scm, entrypoint: spec
ℹ️ info - shuffled with seed 880455787 (replay with VERITAS_SEED=880455787)
+----------------------------------------------+
[📑 suite] Document
[🧪 test] The component schemas are read in order
✅ got: (Pet NewPet)
[⚙️ assert] Pet is a component schema
✅ got: #t
[🧪 test] The title, version and servers are read
✅ got: Petstore
✅ got: 3.0.3
✅ got: https://api.example.com/v1
✅ got: 2
+----------------------------------------------+
[📑 suite] Responses
[🧪 test] A default response is a fallback
✅ got: default
[🧪 test] A response reference is resolved
✅ got: Something went wrong
✅ got: 1
[🧪 test] The success response is found
✅ got: 200
✅ got: application/json
+----------------------------------------------+
[📑 suite] Security
[🧪 test] An empty operation security means public
[⚙️ assert] deleteAnimal opts out
✅ got: ()
[🧪 test] Global security applies to an operation without its own
✅ got: (((api_key)))
[🧪 test] Operation security wins over the global one
✅ got: (((oauth2 write:animals)))
[🧪 test] The security schemes are read
✅ got: (api_key basic_auth bearer_auth oauth2 open_id)
✅ got: http
✅ got: bearer
✅ got: JWT
+----------------------------------------------+
[📑 suite] Operations
[🧪 test] Every path and method becomes an operation
✅ got: (list-pets post-pets get-pet-by-id delete-pets-by-pet-id)
[🧪 test] Method, path, summary and tags are read
✅ got: post
✅ got: /animals
✅ got: Create an animal
✅ got: #f
[🧪 test] operationId wins, otherwise method and path decide
✅ got: list-pets
[⚙️ assert] post-pets has no operationId
✅ got: post-pets
[🧪 test] Path level parameters are inherited
✅ got: (animalId)
[⚙️ assert] a path parameter is required
✅ got: #t
[🧪 test] Operation level parameters win over path level ones
[⚙️ assert] the parameter is not duplicated
✅ got: 1
✅ got: from operation
+----------------------------------------------+
[📑 suite] References
[🧪 test] An unresolvable pointer raises
✅ success catching error: misc-error: (#f JSON pointer does not resolve ~S (#/components/schemas/Nope) #f)
[🧪 test] A pointer escape is understood
[⚙️ assert] the escape sequence for a slash is understood
✅ got: string
[🧪 test] A local pointer resolves
✅ got: object
ℹ️ info - ran 5 tasks in: 0 seconds, 23924 microseconds
running unit tests from file: models-spec.scm, entrypoint: spec
ℹ️ info - shuffled with seed 880455787 (replay with VERITAS_SEED=880455787)
+----------------------------------------------+
[📑 suite] Generated records
[🧪 test] Named scalars, lists and maps validate through their predicates
✅ got: (#t #f #t #f #(a b) #t ())
[🧪 test] A record is constructed, read and validated
✅ got: (cat Mia #t 9 #t #t)
[🧪 test] A value outside the constraints raises
✅ got: ((dog name) Rex)
[🧪 test] A discriminated union decodes into the right record
✅ got: (#t Mia #t #t #t #f (Animal))
[🧪 test] A merge patch replaces and removes members
✅ got: (Tom #f)
[🧪 test] An enumeration is values, constants and a predicate
✅ got: (fresh #t (fish water))
[🧪 test] A missing required member raises with the path of the field
✅ got: (((cat name) is required but is missing))
[🧪 test] A record serialises to jso and back
✅ got: (Mia #t #t #f Mia Mia)
+----------------------------------------------+
[📑 suite] Generated text
[🧪 test] The converters are generated and named after the schema
✅ got: #t
✅ got: #t
✅ got: #t
[🧪 test] An object of only additionalProperties is a map
✅ got: #t
✅ got: #t
[🧪 test] The docstring says where the file came from
✅ got: #t
✅ got: #t
[🧪 test] A union is a predicate and a decoder that uses the discriminator
✅ got: #t
✅ got: #t
[🧪 test] A nullable member is written as null
✅ got: #t
✅ got: #t
✅ got: #t
[🧪 test] The constructor validates what the specification declares
✅ got: #t
✅ got: #t
✅ got: #t
[🧪 test] An absent optional member is left out
✅ got: #t
[🧪 test] A record is a record, a constructor and a predicate
✅ got: #t
✅ got: #t
✅ got: #t
✅ got: #t
✅ got: #t
[🧪 test] An enumeration becomes values and constants
✅ got: #t
✅ got: #t
✅ got: #t
[🧪 test] Composition is flattened into one record
✅ got: #t
✅ got: #t
✅ got: #t
ℹ️ info - ran 2 tasks in: 27 seconds, -350152 microseconds
running unit tests from file: controllers-spec.scm, entrypoint: spec
ℹ️ info - shuffled with seed 880455787 (replay with VERITAS_SEED=880455787)
+----------------------------------------------+
[📑 suite] Generated dispatch
[🧪 test] Handlers receive the decoded parameters and responses are built
✅ got: (200 ((limit . 10)) ((pet-id . 42)) Bella list-pets (GET /nope))
+----------------------------------------------+
[📑 suite] Generated text
[🧪 test] An operation decodes its parameters
✅ got: #t
✅ got: #t
[🧪 test] The Artanis adapter registers one route per operation
✅ got: 4
✅ got: #t
✅ got: #t
[⚙️ assert] each route is a handler
✅ got: #t
[⚙️ assert] responses go through Artanis
✅ got: #t
[⚙️ assert] the concrete path is rebuilt from the parameters
✅ got: #t
[🧪 test] The route table holds one route per operation
✅ got: #t
✅ got: #t
✅ got: #t
✅ got: 4
[🧪 test] A path parameter becomes a capturing group
[⚙️ assert] the name of the captured parameter is kept
✅ got: #t
[🧪 test] A request body is decoded into the record
✅ got: #t
[🧪 test] Handlers are looked up, not guessed
✅ got: #t
✅ got: #t
ℹ️ info - ran 2 tasks in: 1 seconds, 28008 microseconds
running unit tests from file: integration-spec.scm, entrypoint: spec
ℹ️ info - shuffled with seed 880455787 (replay with VERITAS_SEED=880455787)
+----------------------------------------------+
[📑 suite] A whole specification is read
[🧪 test] Every operation and schema is understood
✅ got: 5
✅ got: #t
+----------------------------------------------+
[📑 suite] Generated client from a whole file
[🧪 test] An unset optional header is left out, not sent as #f
✅ got: #t
[🧪 test] An exact response keeps its exact check
✅ got: #t
✅ got: #t
✅ got: #t
[🧪 test] A 2XX response is checked against its family
[⚙️ assert] the search operation accepts every 2xx
✅ got: #t
+----------------------------------------------+
[📑 suite] The whole tree, used
[🧪 test] Records keep their data and the route table dispatches
✅ got: (web ((lang . en) (note . x)) ((source . web) (lang . en) (note . x)) web ((lang . en) (note . x)) (scheme scheme) ((width . 10) (unit . cm)) 12.34 (book ratings) must be a multiple of 0.01 (book counters) ((a . 1) (b . 2)) (book counters) ((a . 1) (b . two)) ((x . y)) ((title . rough) (pages . 3) (notes . later)) rough ((pages . 3) (notes . later)) Structure and Interpretation ((width . 10) (unit . cm)) web ((lang . en) (note . x)) 200 ((limit . 5) (x-request-id . #f)) ((book-id . 3f2504e0-4f89-11d3-9a0c-0305e82c3301)) Compilers 200)
[🧪 test] The generated client talks to a server
✅ got: (200 (SICP) SICP 299 (SICP) 201 Compilers 500)
✅ got: secret
✅ got: limit=5
✅ got: #t
✅ got: secret
✅ got: {"title":"Compilers","price":9.99}
+----------------------------------------------+
[📑 suite] Generated models from a whole file
[🧪 test] uniqueItems is only checked when it is declared
✅ got: 1
✅ got: #t
✅ got: #f
[🧪 test] A record that keeps undeclared members exports their accessor
✅ got: #t
✅ got: #t
[🧪 test] A bare object becomes a map, not an empty record
✅ got: #t
✅ got: #f
[🧪 test] A map is checked against its declared size
✅ got: #t
✅ got: #t
[🧪 test] An inexact multipleOf is generated as declared
✅ got: #t
✅ got: #t
ℹ️ info - ran 4 tasks in: 4 seconds, -19942 microseconds
running unit tests from file: reader-spec.scm, entrypoint: spec
ℹ️ info - shuffled with seed 880455787 (replay with VERITAS_SEED=880455787)
+----------------------------------------------+
[📑 suite] Validation
[🧪 test] 3.x is accepted
✅ got: #t
✅ got: #t
✅ got: #f
✅ got: #f
[🧪 test] A document without an openapi member is refused
✅ success catching error: misc-error: (#f ~A (<string> has no 'openapi' member; not an OpenAPI document) #f)
[🧪 test] An unknown major version is refused
✅ success catching error: misc-error: (#f ~A (<string> declares OpenAPI 4.0.0; only OpenAPI 3.x is supported) #f)
[🧪 test] A Swagger 2.0 document is refused with its version
[⚙️ assert] Swagger is not OpenAPI 3
✅ success catching error: misc-error: (#f ~A (test/fixtures/swagger2.yaml declares Swagger 2.0; only OpenAPI 3.x is supported) #f)
+----------------------------------------------+
[📑 suite] Parsing
[🧪 test] A string is read the same way
✅ got: 3.0.3
[🧪 test] read-spec accepts a path and a document
✅ got: Mini
✅ got: Mini
[🧪 test] YAML and JSON versions of the same document agree
✅ got: 3.0.3
✅ got: object
✅ got: #(id label)
✅ got: #t
+----------------------------------------------+
[📑 suite] Format detection
[🧪 test] Content decides when the name does not
✅ got: json
✅ got: yaml
[🧪 test] A file name decides
✅ got: json
✅ got: yaml
✅ got: yaml
[🧪 test] An unknown extension falls back to YAML
✅ got: yaml
ℹ️ info - ran 3 tasks in: 0 seconds, 13592 microseconds
running unit tests from file: generator-spec.scm, entrypoint: spec
ℹ️ info - shuffled with seed 880455787 (replay with VERITAS_SEED=880455787)
+----------------------------------------------+
[📑 suite] Generation report
[🧪 test] The module name defaults to the API title
[⚙️ assert] mini/models.scm
✅ got: #t
✅ got: #t
[🧪 test] A run writes models, controllers, a client and a README
[⚙️ assert] petstore/models.scm
✅ got: #t
[⚙️ assert] petstore/controllers.scm
✅ got: #t
[⚙️ assert] petstore/client.scm
✅ got: #t
[⚙️ assert] petstore/README.org
✅ got: #t
✅ got: 4
✅ got: models
[🧪 test] The Artanis adapter is written when it is asked for
[⚙️ assert] artanis-app/artanis.scm
✅ got: #t
[⚙️ assert] artanis-app/controllers.scm
✅ got: #t
[🧪 test] Models only, when asked
[⚙️ assert] only/models.scm
✅ got: #t
[⚙️ assert] only/README.org
✅ got: #t
[⚙️ assert] only/controllers.scm
✅ got: #f
[⚙️ assert] only/client.scm
✅ got: #f
✅ got: (models readme)
[🧪 test] The client backend changes the generated client
[⚙️ assert] the curl backend was chosen
✅ got: #t
[🧪 test] The README names the API and its operations
✅ got: #t
✅ got: #t
+----------------------------------------------+
[📑 suite] Command line
[🧪 test] A missing --input is an error
✅ got: 1
[🧪 test] generate is accepted as the first word
✅ got: 0
✅ got: #f
[🧪 test] --help and --version succeed
✅ got: 0
✅ got: 0
[🧪 test] Backend names are parsed
✅ got: artanis
✅ got: none
✅ got: curl
[🧪 test] An unknown controller backend is an error
✅ got: 1
+----------------------------------------------+
[📑 suite] Version
[🧪 test] The generator reports its own version
✅ got: #t
✅ got: #f
+----------------------------------------------+
[📑 suite] Configuration
[🧪 test] An unknown target is an error
✅ got: 1
[🧪 test] The command line overrides the config file
✅ got: 0
✅ got: #t
[⚙️ assert] the config file's guix dependencies are written
✅ got: #t
✅ got: #f
[🧪 test] --dependencies guix writes a manifest
✅ got: 0
✅ got: #t
✅ got: #t
[🧪 test] A config file is read with normalised keys
✅ got: configured
✅ got: Dto
✅ got: (models readme)
✅ got: guix
[🧪 test] A client target brings the models it needs
✅ got: 0
✅ got: #t
✅ got: #t
✅ got: #f
[🧪 test] --targets selects the parts to write
✅ got: 0
✅ got: #t
✅ got: #f
✅ got: #f
✅ got: #f
[🧪 test] --no-validate skips the OpenAPI check
✅ got: 1
✅ got: 0
[🧪 test] A JSON config file is read the same way
✅ got: json-configured
✅ got: Json
✅ got: (models)
✅ got: #f
[🧪 test] --operation-id-transform renames the procedures
✅ got: 0
✅ got: #t
✅ got: #f
[🧪 test] A replacement template can refer to a capture group
✅ got: v2-pets
✅ got: create-pet
[🧪 test] --no-header omits the banner and --header-file adds a paragraph
✅ got: 0
✅ got: #f
✅ got: 0
✅ got: #t
[🧪 test] --model-suffix renames the models
✅ got: 0
✅ got: #t
✅ got: #t
+----------------------------------------------+
[📑 suite] Self-contained trees
[🧪 test] The copied tree loads with only its own directory on the path
✅ got: (cat Mia #t 9 #t #t)
[🧪 test] The runtime is copied next to the generated code
[⚙️ assert] vendored/jso.scm
✅ got: #t
[⚙️ assert] vendored/runtime.scm
✅ got: #t
[⚙️ assert] vendored/models.scm
✅ got: #t
[🧪 test] The copy imports the copy
✅ got: #t
+----------------------------------------------+
[📑 suite] Validating the specification
[🧪 test] #:validate? decides whether an in-memory document is checked
[⚙️ assert] a Swagger document is refused by default
✅ success catching error: misc-error: (#f ~A (<document> declares Swagger 2.0; only OpenAPI 3.x is supported) #f)
[⚙️ assert] skipping validation still runs
✅ got: (readme)
ℹ️ info - ran 6 tasks in: 5 seconds, -115464 microseconds
running unit tests from file: runtime-spec.scm, entrypoint: spec
ℹ️ info - shuffled with seed 880455787 (replay with VERITAS_SEED=880455787)
+----------------------------------------------+
[📑 suite] Authentication
[🧪 test] A cookie API key becomes a Cookie header
✅ got: ((Cookie . session=s))
[🧪 test] A public operation needs no credentials
✅ got: ()
✅ got: ()
[🧪 test] A granted scope satisfies the alternative
✅ got: ((Authorization . Bearer t))
[🧪 test] A bearer token is sent as a bearer token
✅ got: ((Authorization . Bearer t))
[🧪 test] An API key goes in the header it names
✅ got: ((X-API-Key . s))
✅ got: ()
[🧪 test] The first satisfiable alternative wins
✅ got: ((Authorization . Bearer t))
[🧪 test] A query API key goes in the query
✅ got: ()
✅ got: ((api_key . s))
[🧪 test] Basic authentication is base64 of user:password
✅ got: ((Authorization . Basic dTpw))
[🧪 test] A missing scope makes an alternative unsatisfiable
[⚙️ assert] the token does not carry write
✅ success catching error: openapi-auth-error: (no credentials satisfy the security requirements of this operation)
[🧪 test] Extra headers are always sent
✅ got: ((X-Trace . 1))
[🧪 test] Credentials that satisfy nothing raise
[⚙️ assert] no credentials, secured operation
✅ success catching error: openapi-auth-error: (no credentials satisfy the security requirements of this operation)
+----------------------------------------------+
[📑 suite] HTTP values
[🧪 test] Headers are looked up without case
✅ got: application/json
✅ got: application/json
[🧪 test] Query strings encode and decode
✅ got: a=1&c=x%20y
✅ got: ((a . 1) (c . x y) (d . /))
✅ got: ()
[🧪 test] Responses are built with the status they mean
✅ got: 200
✅ got: 201
✅ got: 204
✅ got: #t
✅ got: 401
[🧪 test] A status family stands for every code in it
✅ got: (200 201 202 299)
✅ got: 200
[⚙️ assert] a 500 is outside the 2XX family
✅ success catching error: openapi-http-error: (500 ((status . 500) (message . boom)))
[🧪 test] A request is a value
✅ got: 10
✅ got: application/json
[🧪 test] Path parameters are substituted
✅ got: /pets/a%20b
[🧪 test] A status that was not declared is an error
✅ got: 200
[⚙️ assert] 500 is not 200
✅ success catching error: openapi-http-error: (500 ((status . 500) (message . boom)))
[🧪 test] Setting a header replaces it
[⚙️ assert] the name is stored as it was given
✅ got: ((ACCEPT . text/plain))
+----------------------------------------------+
[📑 suite] Validation
[🧪 test] valid? answers without raising
✅ got: #t
✅ got: #f
[⚙️ assert] an unrelated error is not swallowed
✅ success catching error: wrong-type-arg: (car Wrong type argument in position 1 (expecting pair): ~S (()) (()))
[🧪 test] Formats
✅ got: #t
✅ got: #f
✅ got: #t
✅ got: #t
✅ got: #t
✅ got: #f
✅ got: #t
[⚙️ assert] a format without a rule accepts anything
✅ got: #t
[🧪 test] Numeric ranges
✅ got: #t
✅ got: #t
✅ got: #t
✅ got: #t
✅ got: #t
✅ got: #t
[⚙️ assert] an inexact multiple is accepted within tolerance
✅ got: #t
[⚙️ assert] a whole inexact multiple is accepted
✅ got: #t
[⚙️ assert] an inexact non-multiple is still rejected
✅ got: #t
[⚙️ assert] an exact rational multiple is accepted
✅ got: #t
[🧪 test] A missing required value is reported with its path
✅ got: ((pet name) is required but is missing)
[🧪 test] The wrong type is reported
✅ got: (pet age)
✅ got: (pet age)
[🧪 test] Enumerations
✅ got: #t
✅ got: (s)
[🧪 test] A predicate is checked
✅ got: #t
✅ got: #t
[🧪 test] String length and pattern
✅ got: #t
✅ got: #t
✅ got: #t
✅ got: #t
✅ got: #t
[🧪 test] Collections
✅ got: #t
✅ got: #t
✅ got: #t
✅ got: #t
✅ got: #t
✅ got: (l)
ℹ️ info - ran 3 tasks in: 0 seconds, 55554 microseconds
running unit tests from file: schema-spec.scm, entrypoint: spec
ℹ️ info - shuffled with seed 880455787 (replay with VERITAS_SEED=880455787)
+----------------------------------------------+
[📑 suite] Registry
[🧪 test] Uses of a reference are not given a second name
[⚙️ assert] a $ref body is not a new record
✅ got: #f
[🧪 test] Component schemas keep their names
✅ got: Animal
[🧪 test] An array of references is a list of records
[⚙️ assert] it is a list
✅ got: #t
[⚙️ assert] of records
✅ got: #t
✅ got: Animal
[🧪 test] A reference becomes a record shape
[⚙️ assert] it is a record reference
✅ got: #t
✅ got: Owner
+----------------------------------------------+
[📑 suite] Shapes
[🧪 test] A nullable member is nullable
✅ got: #t
[🧪 test] A named scalar keeps its constraints
✅ got: #t
✅ got: email
✅ got: ^[^@]+@[^@]+\.[^@]+$
[🧪 test] An object of only additionalProperties is a map
✅ got: #t
✅ got: #t
[🧪 test] A component array is a list of scalars
✅ got: #t
✅ got: string
[🧪 test] An enumeration is an enumeration
✅ got: #t
✅ got: (fresh salt)
[🧪 test] A string with a format is a scalar with that format
✅ got: #t
✅ got: date-time
+----------------------------------------------+
[📑 suite] Constraints
[🧪 test] Numeric constraints are read
✅ got: 0
✅ got: 200
[🧪 test] Array constraints are read
✅ got: 1
✅ got: #t
[🧪 test] String constraints are read
✅ got: 1
✅ got: 40
+----------------------------------------------+
[📑 suite] Composition
[🧪 test] The parent's required members stay required
✅ got: #t
[🧪 test] oneOf keeps its branches and discriminator
✅ got: #t
✅ got: kind
✅ got: 3
✅ got: ((cat . Cat) (dog . Dog) (fish . Fish))
[🧪 test] allOf is flattened into one object
✅ got: #t
✅ got: (kind name born age weight nickname tags owner extra indoor lives)
[⚙️ assert] the child's required member is required
✅ got: #t
ℹ️ info - ran 4 tasks in: 0 seconds, 33160 microseconds
running unit tests from file: code-spec.scm, entrypoint: spec
ℹ️ info - shuffled with seed 880455787 (replay with VERITAS_SEED=880455787)
+----------------------------------------------+
[📑 suite] One line
[🧪 test] Quoted data prints with a quote
✅ got: '()
[⚙️ assert] an association keeps its dot
✅ got: '(("a" . "b"))
[🧪 test] A call that fits keeps its arguments together
✅ got: (list 1 2 3)
[🧪 test] Strings are literals, quotes and all
✅ got: (display "a \"quoted\" word")
[🧪 test] An empty list is the empty list
✅ got: (list)
[🧪 test] A form that fits stays on one line
✅ got: (list 1 2 3)
[🧪 test] A keyword prints as a keyword
✅ got: (f #:key value)
+----------------------------------------------+
[📑 suite] Documents
[🧪 test] A docstring keeps its lines
✅ got: ((define (f value) "Check VALUE. Returns #t." value))
+----------------------------------------------+
[📑 suite] Data
[🧪 test] Consecutive forms are separated by a blank line
✅ got: ((list 1) (list 2))
[🧪 test] A long literal stacks its elements under the quote
✅ got: '(("type" . "apiKeyHeader")
✅ got: ("description" . "a long one"))
[🧪 test] A comment belongs to the form below it
✅ got: ((list 1) ;; Why b is 2 (list 2))
+----------------------------------------------+
[📑 suite] Broken forms
[🧪 test] A cond puts one clause per line
✅ got: ((cond ((eq? kind 'cat) (jso->cat value)) (else (jso->dog value))))
[🧪 test] A long argument list puts one argument per line
✅ got: (define* (make-pet #:key
[⚙️ assert] an argument sits on a line of its own
✅ got: id
[⚙️ assert] the signature is closed after its last argument
✅ got: #f)))
[🧪 test] A record type names its constructor, predicate and fields
✅ got: ((define-record-type <pet> (%make-pet id name tags) pet? (id pet-id) (name pet-name) (tags pet-tags)))
[🧪 test] A let lines up its bindings
✅ got: ((let ((path (params->path "/pets" '())) (response (client-send client 'GET path))) (values path response)))
[🧪 test] An if lines its branches up under the test
✅ got: ((if (eq? value #f) '() (list value)))
[🧪 test] A module header puts every clause on its own line
✅ got: ((define-module (petstore models) #:use-module (srfi srfi-1) #:export (pet? make-pet)))
[🧪 test] A definition indents its body
✅ got: ((define (pet-name value) (jso-ref (pet->jso value) "name")))
[⚙️ assert] a definition always breaks
✅ got: ((define empty '()))
[🧪 test] A keyword argument starts a line and keeps its value
[⚙️ assert] the keyword and its value share a line
✅ got: #t
[🧪 test] A long call wraps its arguments under the first one
[⚙️ assert] the call starts the first line
✅ got: #t
[⚙️ assert] no line passes the width
✅ got: #t
ℹ️ info - ran 4 tasks in: 0 seconds, 28008 microseconds
running unit tests from file: naming-spec.scm, entrypoint: spec
ℹ️ info - shuffled with seed 880455787 (replay with VERITAS_SEED=880455787)
+----------------------------------------------+
[📑 suite] Splitting words
[🧪 test] Separators split too
✅ got: (pet id)
✅ got: (pet id)
✅ got: (pets pet id)
[🧪 test] Digits stay with their word
✅ got: (int64)
[🧪 test] camelCase and PascalCase split
✅ got: (pet photo urls)
✅ got: (list pets)
[🧪 test] A run of capitals is one word
[⚙️ assert] the last capital starts the next word
✅ got: (http response)
+----------------------------------------------+
[📑 suite] Safe identifiers
[🧪 test] An empty name becomes something bindable
✅ got: unnamed
[🧪 test] An ordinary name is only case-folded
✅ got: pet-photo-urls
[🧪 test] An identifier never starts with a digit
✅ got: n-3d-model
[🧪 test] A reserved word gains a suffix
✅ got: else-field
✅ got: quote-field
✅ got: lambda-field
+----------------------------------------------+
[📑 suite] Scheme entities
[🧪 test] Enumeration constants carry the value
✅ got: pet-status-in-progress
[🧪 test] Records, predicates, constructors and accessors
✅ got: <pet>
✅ got: pet?
✅ got: make-pet
✅ got: pet-photo-urls
[🧪 test] A module name is a list of symbols
✅ got: (petstore controllers artanis)
+----------------------------------------------+
[📑 suite] Case conversion
[🧪 test] kebab, snake and Pascal
✅ got: pet-photo-urls
✅ got: pet_photo_urls
✅ got: PetPhotoUrls
✅ got: petPhotoUrls
✅ got: PET_PHOTO_URLS
+----------------------------------------------+
[📑 suite] Operations
[🧪 test] Without an operationId, method and path decide
✅ got: get-pets-by-pet-id
✅ got: delete-pets-by-pet-id
[🧪 test] The operationId wins when it exists
✅ got: list-pets
[🧪 test] A path becomes a slug
✅ got: pets-by-pet-id-photos
✅ got: root
ℹ️ info - ran 5 tasks in: 0 seconds, 28380 microseconds
running unit tests from file: jso-spec.scm, entrypoint: spec
ℹ️ info - shuffled with seed 880455787 (replay with VERITAS_SEED=880455787)
+----------------------------------------------+
[📑 suite] JSON merge patch
[🧪 test] A null member deletes the target member
[⚙️ assert] b is removed
✅ got: ((a . 1))
[🧪 test] A patch that is not an object replaces the target
[⚙️ assert] RFC 7386: anything else replaces
✅ got: #(1 2)
[🧪 test] A nested null deletes a nested member
[⚙️ assert] d is removed from the nested object
✅ got: ((a . 1) (b . 2) (c))
[🧪 test] A member that is absent from the patch is untouched
[⚙️ assert] b and c survive, only a changes
✅ got: ((a . 9) (b . 2) (c (d . 4)))
[🧪 test] A member replaces the target member
[⚙️ assert] b is replaced, a is kept
✅ got: ((a . 1) (b . 3))
[🧪 test] Objects merge recursively
[⚙️ assert] nested members merge, they do not replace
✅ got: ((c (d . 5) (e . 6)))
+----------------------------------------------+
[📑 suite] Accessors
[🧪 test] jso-ref-path walks nested objects
✅ got: 4
[⚙️ assert] a missing step yields #f
✅ got: #f
[🧪 test] jso-put keeps the position of an existing member
✅ got: ((a . 9) (b . 2))
[🧪 test] jso-delete removes one member
✅ got: ((a . 1) (c 4))
[🧪 test] Keys and values keep the document order
✅ got: (a b c)
✅ got: (1 2 ((d . 4)))
[🧪 test] jso-append lets later entries win
✅ got: ((a . 2) (b . 1))
[🧪 test] A deep copy shares no pairs
✅ got: ((a . 1) (b . 2) (c (d . 4)))
[⚙️ assert] the nested object is a copy
✅ got: #f
+----------------------------------------------+
[📑 suite] Normalisation
[🧪 test] Normalisation descends into arrays
✅ got: #(((name . Pet)))
[🧪 test] Symbol keys become strings
✅ got: ((name . Pet))
[🧪 test] A jso object round-trips through JSON
✅ got: 1
✅ got: 4
✅ got: (a b c)
+----------------------------------------------+
[📑 suite] Objects and arrays
[🧪 test] null is a value, not an absence
[⚙️ assert] the member is present
✅ got: #t
[⚙️ assert] and it holds null
✅ got: #t
[⚙️ assert] an absent member falls back to the default
✅ got: nothing
[🧪 test] A parsed object has string keys
✅ got: ((name . Pet))
[🧪 test] Arrays are vectors
[⚙️ assert] a JSON array is a vector
✅ got: #t
[🧪 test] An empty object is the empty list
[⚙️ assert] nothing is in it
✅ got: ()
ℹ️ info - ran 4 tasks in: 0 seconds, 13222 microseconds
running unit tests from file: yaml-spec.scm, entrypoint: spec
ℹ️ info - shuffled with seed 880455787 (replay with VERITAS_SEED=880455787)
+----------------------------------------------+
[📑 suite] Scalars
[🧪 test] Quoted scalars keep their content
[⚙️ assert] double quoted escapes
✅ got: a: colon, "quote" and
newline
[⚙️ assert] a doubled quote is an escaped quote
✅ got: it's fine
[🧪 test] A comment is not part of the value
[⚙️ assert] a # starts a comment only after a space
✅ got: ((a . 1) (b . x#not-a-comment))
[🧪 test] Booleans are booleans
✅ got: #t
✅ got: #f
[🧪 test] Version-like scalars stay strings
[⚙️ assert] 3.0.3 is not a number
✅ got: 3.0.3
[🧪 test] Numbers are numbers
✅ got: 42
✅ got: -7
✅ got: 3.5
✅ got: 1000.0
✅ got: 31
[🧪 test] A key with no value is null
[⚙️ assert] empty_value is json-null
✅ got: #t
+----------------------------------------------+
[📑 suite] Collections
[🧪 test] A flow sequence is a vector
[⚙️ assert] every element has the right type
✅ got: #(1 2.5 #t null text)
[🧪 test] A flow mapping nests
✅ got: ((a . 1) (b . #(2 3)) (c (d . 4)))
[🧪 test] Deeply nested mappings are read
✅ got: ((a (b (c . 1))))
[🧪 test] A sequence of mappings is read whole
[⚙️ assert] two items
✅ got: 2
✅ got: second
✅ got: #(3 4)
[🧪 test] A sequence may sit at the indentation of its key
[⚙️ assert] - may be at the same column as k
✅ got: ((k . #(a b)))
+----------------------------------------------+
[📑 suite] Anchors
[🧪 test] An unknown alias is an error
[⚙️ assert] *nope has no anchor
✅ success catching error: misc-error: (#f YAML: unknown alias ~S (nope) #f)
[🧪 test] A merge key overlays an anchored mapping
[⚙️ assert] the merged member is present
✅ got: #t
[⚙️ assert] the explicit member wins
✅ got: 3
[🧪 test] An alias repeats the anchored value
[⚙️ assert] copy equals base
✅ got: ((shared . #t) (count . 2))
+----------------------------------------------+
[📑 suite] Block scalars
[🧪 test] A literal block keeps its line breaks
[⚙️ assert] the clip chomping adds one newline
✅ got: first line
second line
[🧪 test] A folded block joins its lines with spaces
[⚙️ assert] the strip chomping removes the trailing newline
✅ got: one two three
four
[🧪 test] The indentation of the block is removed
[⚙️ assert] relative indentation survives
✅ got: a
b
+----------------------------------------------+
[📑 suite] Documents
[🧪 test] An empty document is null
[⚙️ assert] nothing is null
✅ got: #t
[🧪 test] A tab cannot indent a line
[⚙️ assert] a tab raises instead of guessing
✅ success catching error: misc-error: (#f YAML: a tab cannot be used for indentation ~S ( b: 1) #f)
[🧪 test] Document markers and directives are ignored
✅ got: ((a . 1))
[🧪 test] The petstore fixture reads
✅ got: 3.0.3
[⚙️ assert] components is an object
✅ got: #t
ℹ️ info - ran 5 tasks in: 0 seconds, 39075 microseconds
finished running tests
;;; compiled /tmp/.cache/guile/ccache/3.0-LE-8-4.7/etc/byggsteg/job-clone/guile-openapi-generator/trunk/test/openapi-support.scm.go
;;; note: source file ./test/veritas/unit/generator-spec.scm
;;; newer than compiled /tmp/.cache/guile/ccache/3.0-LE-8-4.7/etc/byggsteg/job-clone/guile-openapi-generator/trunk/test/veritas/unit/generator-spec.scm.go
;;; compiling ./test/veritas/unit/generator-spec.scm
;;; compiling ./src/openapi-generator/config-file.scm
;;; compiled /tmp/.cache/guile/ccache/3.0-LE-8-4.7/etc/byggsteg/job-clone/guile-openapi-generator/trunk/src/openapi-generator/config-file.scm.go
;;; note: source file ./src/openapi-generator/cli.scm
;;; newer than compiled /tmp/.cache/guile/ccache/3.0-LE-8-4.7/etc/byggsteg/job-clone/guile-openapi-generator/trunk/src/openapi-generator/cli.scm.go
;;; compiling ./src/openapi-generator/cli.scm
;;; compiled /tmp/.cache/guile/ccache/3.0-LE-8-4.7/etc/byggsteg/job-clone/guile-openapi-generator/trunk/src/openapi-generator/cli.scm.go
;;; compiled /tmp/.cache/guile/ccache/3.0-LE-8-4.7/etc/byggsteg/job-clone/guile-openapi-generator/trunk/test/veritas/unit/generator-spec.scm.go
guile-openapi-generator 0.1.0
Read an OpenAPI 3.x specification and generate Guile code.
Usage: openapi-generator generate --input SPEC --output DIR
[options]
--help (-h) Show this help and exit.
--version (-v) Show the version and exit.
--config VALUE Read options from a YAML or JSON file; flags override it.
--input (-i) VALUE The OpenAPI 3.x specification to read (.yaml or .json).
--output (-o) VALUE The directory to write the generated code to.
--module (-m) VALUE The root module name (default: the API title).
--targets (-t) VALUE Comma-separated: models, controllers, client, readme.
--controllers (-c) VALUE vanilla, artanis or none (default: vanilla).
--http (-H) VALUE guile, curl or none (default: guile).
--no-models Generate no record module.
--model-suffix VALUE Append SUFFIX to every generated model name.
--operation-id-transform VALUE Rename operationIds as REGEX:REPLACEMENT.
--base-url VALUE Override the first server URL of the specification.
--self-contained Copy the runtime modules next to the generated code.
--no-validate Do not check that the input is OpenAPI 3.x.
--no-header Omit the banner comment from generated files.
--header-file VALUE Add the contents of FILE to the generated banner.
--dependencies VALUE none or guix: write a dependencies.scm manifest.
Examples:
openapi-generator generate -i petstore.yaml -o gen
openapi-generator generate -i petstore.yaml -o gen -c artanis -H curl
openapi-generator generate --config openapi-generator.yaml
openapi-generator generate -i api.yaml -o gen -t models,client
openapi-generator: --input is required
openapi-generator: Unknown controller backend phoenix; expected one of none, vanilla, artanis
openapi-generator: Unknown target clients; expected one of models, controllers, client, readme
openapi-generator: test/fixtures/swagger2.yaml declares Swagger 2.0; only OpenAPI 3.x is supported
--------------------------------------------------------------
Maak: the infinitely extensible command runner
Loading tasks from Maak file: /etc/byggsteg/job-clone/guile-openapi-generator/trunk/maak.scm
Executing Maak tasks: test
--------------------------------------------------------------
=> Running Maak task: test
Run the project's Veritas test suites.