Skip to main content

Release notes

What changed in each release of the five @spartaficial packages, for people upgrading or deciding when to. The packages are versioned together; a version number here applies to openapi-core, openapi-to-typescript, openapi-to-zod, openapi-to-zod-playwright and openapi-to-k6 alike.

2.0.0​

2.0.0 is the first release published under the @spartaficial scope. It changes some defaults and some generated output relative to 1.0.0, so regenerate after upgrading and read the breaking changes before you do.

Breaking​

  • Generation requires a licence key in SPARTAFICIAL_LICENSE_KEY. One key covers every package in every project you own and can optionally be restricted to a single project. --help, --version and init run without one, and compiling or testing code that was already generated never needs one. The packages move from MIT to the Spartaficial Commercial License; code you generate remains yours, without restriction or royalty. See Licensing.
  • mode defaults to "strict" in the Zod and Playwright generators, so object schemas are emitted as z.strictObject() and a property the specification does not describe fails validation. Set mode: "normal" to restore the previous output.
  • zodErrorFormat defaults to "prettifyWithValues" in the Playwright generator. Generated service methods throw a ZodValidationError whose message names the failing path and the value received, instead of a raw ZodError. Set zodErrorFormat: "standard" if your tests inspect error.issues.
  • A $ref to an http(s) URL now fails the run unless refMappings points the URL at a local file. Previously it produced a warning that was never shown and a generated file naming a type nothing declared.
  • Query parameters follow the style and explode the specification declares. The OpenAPI default sends an array as ?tags=a&tags=b where the Playwright client used to send ?tags=a,b; declare style: form, explode: false to keep the comma form. serializeParams returns URLSearchParams instead of a plain object, and null or undefined values are omitted.
  • schemaType is no longer accepted by the k6 and Playwright generators, which never acted on it. Setting it is now a configuration error. Generated output is unchanged.
  • The Zod generator honours default: a non-required property with a default generates .default(value) instead of .optional(), so parse({}) returns the default. if/then/else now follows JSON Schema semantics, so an object that omits the property named in if takes the then branch where it previously took else.
  • Only schemas that are actually on a reference cycle are treated as circular, so some schemas lose their z.lazy() wrapper and may move in the emitted order. stripPathPrefix matches at a segment boundary only, so "/api" no longer rewrites /apikeys/{id}.
  • The zod peer dependency of the Playwright generator is ^4.0.0 rather than >=4.0.0, matching the Zod generator, because the runtime helpers depend on Zod 4 internals.
  • The public entry point of @spartaficial/openapi-core no longer re-exports TemplateError, createWarningLogger, findSpecFiles, generateMethodNameFromPath, generateMinimalJSDoc, getStatusCodeName, isGlobPattern, isMediaTypeContent, isOpenAPIOperation, isRecord, isResolvedRequestBody, isResolvedResponse, stripAffixes, stripSuffix and their types. @spartaficial/openapi-to-k6 drops the K6Response alias; import Response from k6/http.

New​

  • refMappings redirects remote $ref URLs to local directories by longest matching prefix, so a specification exported from a schema registry generates offline and reproducibly. Reference warnings from the loader now reach you in every generator.
  • A $ref may name another local document. The referenced file is read when the specification is loaded, the target is inlined into your components, references are followed transitively, cycles terminate, and a target whose name clashes with one of yours is inlined under a qualified name with a warning. Every component type is supported, as is #/definitions/<name> in a Swagger 2.0 file.
  • Parameter serialisation is complete: form, spaceDelimited, pipeDelimited and deepObject for query parameters, simple, label and matrix for path parameters, allowReserved for query values, and percent-encoding of path parameters, in both the Playwright and the k6 client.
  • Name collisions are reported by every generator. Two schemas or two operations that normalise to one identifier still generate, and a warning names both sources.
  • schemaType can be set in a configuration file for the TypeScript generator, including from defaults. The TypeScript generator applies readOnly, writeOnly and defaultNullable, and the Zod generator forwards schemaType so both files of a separate-schemas pair describe the same shape.
  • The k6 service reads a response body as JSON, text or raw bytes according to its declared content type, so a text/plain endpoint or an HTML error page no longer throws before result.ok can be inspected. Form and multipart request bodies are handed to k6 unchanged, and the multipart Content-Type header is left to k6 so it can add the boundary. openapi-to-k6 gains -s, --output-service in direct mode.
  • Objects that constrain keys without declaring properties (minProperties, propertyNames) now accept the keys they constrain in strict mode instead of rejecting every input.
  • Using a generator from code (new OpenApiGenerator(spec).generate() and its siblings) verifies the licence from the environment on first use and reports failures with the same wording as the command line. A key restricted to one project says so in every message, and a project mismatch names both projects and, when no config file was used, the directory that was read.
  • A .ts configuration that imports a module which is not installed reports Cannot load <file>: the module '<name>' is not installed. with what to do, instead of a stack trace. A missing esbuild has its own wording.
  • Pointing a generator at an empty, blank or non-object file reports an Empty or invalid OpenAPI specification error naming the file instead of a TypeError.
  • @spartaficial/openapi-core adds runInitCommand, the shared init scaffold; mergeAllSpecsWithDeprecatedOutput and refineOutputPaths for generators that accept the deprecated output alias; and getResolvedConfigPath() on the loader returned by createConfigLoader, which is how a project-restricted key is resolved from the config file's directory rather than the working directory.
  • Every package README states the commercial licence, what runs without a key and the correct requirements (Node.js 20, @playwright/test >=1.48.0, zod ^4.0.0). @spartaficial/openapi-to-k6 is published minified without source maps like the other packages, which shrinks its tarball to roughly a third.

Fixed​

  • The TypeScript generator no longer emits types that do not parse: an object with no properties produced { ; } and an allOf of bare types produced = ;. Descriptions containing */, and enum values and property names containing quotes, are escaped. A property declaring oneOf alongside type: object keeps its members; an object with both properties and additionalProperties keeps its index signature; a dictionary keeps the value type its additionalProperties declares; a component-level 3.1 type array no longer becomes unknown; a response with two content types emits both; a request body or response behind a $ref produces a type; and a $ref that does not resolve is reported instead of emitting a name nothing declares.
  • The Zod generator declares schemas in dependency order when one is reached through an alias, which previously produced ReferenceError: Cannot access 'baseSchema' before initialization on import. Conditions in if/then/else check types properly (integer against Number.isInteger, array against Array.isArray, null against === null). Property names, refine messages, condition literals and contentEncoding values containing quotes or backslashes are escaped; a pattern that is not a valid regular expression is dropped with a warning; a multi-line pattern no longer breaks the expression; constraints beside a $ref in an allOf are applied; and in separate-schemas mode useOperationId and ignoreHeaders reach the type file so both files agree on names.
  • The Playwright generator keeps parameters declared at path level or behind a $ref in its method signatures, folds whitespace and invalid identifier characters (such as the : of a custom method) out of path segments so that schemas and service agree on names, chooses the request content type by preferredContentTypes rather than key order, and honours allowReserved by handing such queries to Playwright as a pre-built string.
  • The k6 generator writes the service file with its header once, escapes */ in parameter descriptions, and no longer loses an option's default when an explicit undefined is passed. The same undefined fix applies to the Playwright generator.
  • The specification cache includes refMappings in its key, so two runs over the same file with different mappings no longer share a result. ignoreHeaders no longer warns that a pattern matched nothing when the header is declared on the path item or behind a $ref. A 2XX response key yields a success response rather than status code 2. The discriminator check follows allOf and $ref when verifying the property is required. A failed write from the TypeScript generator raises the package's typed error rather than a bare Node error.

1.0.0​

Initial public release.