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,--versionandinitrun 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. modedefaults to"strict"in the Zod and Playwright generators, so object schemas are emitted asz.strictObject()and a property the specification does not describe fails validation. Setmode: "normal"to restore the previous output.zodErrorFormatdefaults to"prettifyWithValues"in the Playwright generator. Generated service methods throw aZodValidationErrorwhose message names the failing path and the value received, instead of a rawZodError. SetzodErrorFormat: "standard"if your tests inspecterror.issues.- A
$refto anhttp(s)URL now fails the run unlessrefMappingspoints 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
styleandexplodethe specification declares. The OpenAPI default sends an array as?tags=a&tags=bwhere the Playwright client used to send?tags=a,b; declarestyle: form, explode: falseto keep the comma form.serializeParamsreturnsURLSearchParamsinstead of a plain object, andnullorundefinedvalues are omitted. schemaTypeis 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(), soparse({})returns the default.if/then/elsenow follows JSON Schema semantics, so an object that omits the property named iniftakes thethenbranch where it previously tookelse. - 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.stripPathPrefixmatches at a segment boundary only, so"/api"no longer rewrites/apikeys/{id}. - The
zodpeer dependency of the Playwright generator is^4.0.0rather than>=4.0.0, matching the Zod generator, because the runtime helpers depend on Zod 4 internals. - The public entry point of
@spartaficial/openapi-coreno longer re-exportsTemplateError,createWarningLogger,findSpecFiles,generateMethodNameFromPath,generateMinimalJSDoc,getStatusCodeName,isGlobPattern,isMediaTypeContent,isOpenAPIOperation,isRecord,isResolvedRequestBody,isResolvedResponse,stripAffixes,stripSuffixand their types.@spartaficial/openapi-to-k6drops theK6Responsealias; importResponsefromk6/http.
New
refMappingsredirects remote$refURLs 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
$refmay 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,pipeDelimitedanddeepObjectfor query parameters,simple,labelandmatrixfor path parameters,allowReservedfor 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.
schemaTypecan be set in a configuration file for the TypeScript generator, including fromdefaults. The TypeScript generator appliesreadOnly,writeOnlyanddefaultNullable, and the Zod generator forwardsschemaTypeso 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/plainendpoint or an HTML error page no longer throws beforeresult.okcan be inspected. Form and multipart request bodies are handed to k6 unchanged, and the multipartContent-Typeheader is left to k6 so it can add the boundary.openapi-to-k6gains-s, --output-servicein 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
.tsconfiguration that imports a module which is not installed reportsCannot load <file>: the module '<name>' is not installed.with what to do, instead of a stack trace. A missingesbuildhas its own wording. - Pointing a generator at an empty, blank or non-object file reports an
Empty or invalid OpenAPI specificationerror naming the file instead of aTypeError. @spartaficial/openapi-coreaddsrunInitCommand, the sharedinitscaffold;mergeAllSpecsWithDeprecatedOutputandrefineOutputPathsfor generators that accept the deprecatedoutputalias; andgetResolvedConfigPath()on the loader returned bycreateConfigLoader, 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-k6is 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 anallOfof bare types produced= ;. Descriptions containing*/, and enum values and property names containing quotes, are escaped. A property declaringoneOfalongsidetype: objectkeeps its members; an object with bothpropertiesandadditionalPropertieskeeps its index signature; a dictionary keeps the value type itsadditionalPropertiesdeclares; a component-level 3.1 type array no longer becomesunknown; a response with two content types emits both; a request body or response behind a$refproduces a type; and a$refthat 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 initializationon import. Conditions inif/then/elsecheck types properly (integeragainstNumber.isInteger,arrayagainstArray.isArray,nullagainst=== null). Property names, refine messages, condition literals andcontentEncodingvalues containing quotes or backslashes are escaped; apatternthat is not a valid regular expression is dropped with a warning; a multi-linepatternno longer breaks the expression; constraints beside a$refin anallOfare applied; and in separate-schemas modeuseOperationIdandignoreHeadersreach the type file so both files agree on names. - The Playwright generator keeps parameters declared at path level or behind a
$refin 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 bypreferredContentTypesrather than key order, and honoursallowReservedby 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 explicitundefinedis passed. The sameundefinedfix applies to the Playwright generator. - The specification cache includes
refMappingsin its key, so two runs over the same file with different mappings no longer share a result.ignoreHeadersno longer warns that a pattern matched nothing when the header is declared on the path item or behind a$ref. A2XXresponse key yields a success response rather than status code2. The discriminator check followsallOfand$refwhen 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.