GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — genoc/CHANGELOG.md at master · TheAsda/genoc

Expand file tree

/

CHANGELOG.md

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
151 lines (87 loc) · 18 KB
/

CHANGELOG.md

Copy path

File metadata and controls

151 lines (87 loc) · 18 KB
Raw
Copy raw file
Download raw file
Outline
Edit and raw actions

genoc

0.5.4

Patch Changes

  • e65dc4a: Fix multipart form field types: non-file fields no longer collapse to string. A multipart/form-data body property declared via $ref (e.g. an object schema) previously rendered as string in the body type and was appended raw to FormData (serializing to [object Object]). Non-binary fields now keep their schema type through the mapper ($ref → the referenced named type, arrays → T[], numbers/booleans → their primitive), and the generated client appends non-string fields as JSON.stringify(...) while string-valued fields (including $refs to string schemas) keep direct appends. Binary handling (FileInput/FileInput[]) is unchanged.

    A multipart body whose whole schema is a single $ref to a component now reuses that component type (PostXBody = PostRequest) instead of emitting a flattened copy beside it; the component's own definition is rendered through the form-field mapping. This applies only when the component has no other $ref consumers (another operation, content type, or schema would still need the raw mapping); types whose last reference is dropped by the form-mapped rendering are pruned instead of lingering unused.

    Hardening: nullable string fields append behind a null guard (string | null does not satisfy FormData's string | Blob); arrays whose items is a $ref to a binary schema upload as FileInput[]; orphan pruning no longer drops types used as client path-parameter types and removes whole orphaned dependency chains.

0.5.3

Patch Changes

  • e46b2b0: Concrete discriminator bases now join their own {Base}Variant unions. Previously, refs to a base with no oneOf/anyOf (or listed in its own mapping) could name an undeclared union type, a self-mapped base collapsed its children to never through conflicting discriminant literals, and mapping-children-only families omitted the base from its own union. Variants of a concrete base now strip the discriminant via Omit<Base, '$disc'>, implicit direct-allOf children count as variants, and families with no members fall back to bare base names instead of emitting an unused union. Generated output shape changes for specs with concrete discriminator bases: existing variant unions gain the base as a member. Fixes #93.
  • e46b2b0: Warn on binary file data declared under application/x-www-form-urlencoded request bodies, and fix multipart bodies that declare their form fields via allOf. A urlencoded body containing format: binary fields cannot transport them, but previously typed them silently as plain strings; genoc now prints a warning naming the offending fields (found through allOf, $ref, arrays, and nested objects, cycle-safe). Separately, a multipart/form-data body whose fields live in allOf members used to collapse to Record<string, never> and drop every FormData append — the multipart property walk now merges allOf members (recursively, resolving $refs, unioning required), so those fields generate as FileInput/FileInput[]/string fields again.

0.5.2

Patch Changes

  • 7a29f34: Concrete discriminator bases now join their own {Base}Variant unions. Previously, refs to a base with no oneOf/anyOf (or listed in its own mapping) could name an undeclared union type, a self-mapped base collapsed its children to never through conflicting discriminant literals, and mapping-children-only families omitted the base from its own union. Variants of a concrete base now strip the discriminant via Omit<Base, '$disc'>, implicit direct-allOf children count as variants, and families with no members fall back to bare base names instead of emitting an unused union. Generated output shape changes for specs with concrete discriminator bases: existing variant unions gain the base as a member. Fixes #93.

0.5.1

Patch Changes

  • 2eeec7b: Accept empty-string info.title and info.version. The OpenAPI specification requires these fields to be present strings but imposes no requirement on the value, so title: "" / version: "" are no longer rejected. Fixes #85.

0.5.0

Minor Changes

  • 66fe206: Generated clients now pass the operation's effective security requirements to the requester: Requester options gain security?: readonly SecurityRequirement[] (OR-of-ANDs of { schemeName, scopes, scheme } with the fully-resolved scheme object, oauth2 flows included), and the runtime exports SecurityScheme, SecurityCall, SecurityRequirement, OAuthFlow, and OAuthFlows. Contracts add a SecuritySchemeName union of the declared scheme keys. Ops declared security: [] or with no requirements send no security field. securitySchemes/security are now validated per the OpenAPI spec (required fields per scheme type — $ref schemes included, unknown names/types, version-scoped scope rules, mutualTLS in 3.1 only, security on a Path Item rejected). Note: if you pin an older genoc/runtime via --runtime-import-path, clients generated from specs with security requirements will fail type-checking against it (excess property). (#17)

Patch Changes

  • b256dae: Fix DefaultApiError to extend ApiError<number, TData>: generated catch blocks now re-throw it unchanged instead of wrapping it in RequesterFailError. isDefinedError explicitly returns false for it (a default-response error is not part of the per-status error union) - catch it with instanceof DefaultApiError. Documented in the error-handling guide. Fixes #79.
  • 9abd899: Validation errors that report a spec violation now link to the section of the OpenAPI specification that states the violated rule (e.g. https://spec.openapis.org/oas/v3.1.1.html#info-version), each dialect at its latest patch release. When --spec-version overrides detection, the override decides which page is linked; for documents whose dialect is unknown, --spec-version is used and 3.1.1 is the default. Unsupported features (Swagger 2.0, OpenAPI 3.2, external $refs) remain link-free: those documents are valid and the errors cite a genoc limitation, not a specification rule. Version/dialect rules now live solely in the version module (the spec reader no longer duplicates them). Fixes #83.

0.4.3

Patch Changes

  • 39f4367: Generated clients now type path parameters from their schemas instead of always string — type: integer/number produces number | string, type: boolean produces boolean | string, enums become unions of their literals widened by string, and $refs resolve to the named contract type widened by string. The string arm is the escape hatch: pass a pre-formatted string when the default serialization is not what your API expects. Typed values are serialized inline with String() before URL-encoding. createClient(requester) takes no options. (#71)

0.4.2

Patch Changes

  • 4e8d64f: Fixed generated client signatures placing an optional (?:) parameter before a required one, which produced invalid TypeScript (error TS1016: A required parameter cannot follow an optional parameter) — for example an operation with an optional request body and a required header generated body?: PostApiV1EntityBody, headers: PostApiV1EntityHeaders. Optional parameters that precede a required one are now rendered as name: T | undefined instead of name?: T, uniformly for every parameter slot (query, body, headers), replacing the previous query-only special case. (#63)

0.4.1

Patch Changes

  • d871e0e: Fixed discriminator cross-variant inheritance collapsing generated variants to never (the .NET System.Text.Json polymorphism style, where each variant inherits the discriminated base). Discriminator literals are now injected exactly once — at each mapping target's own named definition — and same-family variant references render as Omit<Sibling, 'Prop'> instead of re-inlining the parent literal. Every discriminated family also emits a collision-safe {Base}Variant union (mapping values ∪ oneOf refs), and a $ref to a discriminator base resolves to that union at all usage sites. Also fixes four latent analyzer bugs: repeated sibling $refs dropping all properties, injected literals binding only to the last member of a union, implicit variant literals using the sanitized type name instead of the raw ref segment, and mapping keys containing ' / \ producing syntactically invalid TypeScript.
  • d871e0e: The 'nullable' is deprecated in OpenAPI 3.1 generation warning is now gated by the effective spec dialect: it only fires when generating from a 3.1 spec, where type: ["string", "null"] is the modern replacement. OpenAPI 3.0 specs — where nullable is the correct and only mechanism — no longer produce the warning. The effective dialect is sourced from version detection (honoring --spec-version overrides) and threaded through the pipeline into the analyzer; as part of this, SchemaMapper now takes an options object instead of positional constructor parameters.
  • c0ee6dc: undici is no longer bundled as a regular dependency: it moved to an optional peer dependency (^6.13.0 || ^7 || ^8). Fetching specs through a proxy now requires installing it yourself (npm install undici); genoc keeps working without undici when no proxy is configured. The Node.js engine floor rises from 18 to 20.18.1 — the minimum required by undici v7, which the peer range now admits. A missing undici during a proxied fetch now produces an actionable install hint instead of a wrapped fetch failure.

0.4.0

Minor Changes

  • 5531827: Config file support: genoc now reads its settings from .genocrc.yml or .genocrc.json, discovered from the current directory up to the git repository boundary, or loaded explicitly with the new --config flag. A flat config generates a single client; a clients map generates multiple clients sequentially in one run — a failing target does not stop the loop, failures are aggregated (× client "<name>": …, exit 1 if any target failed) — and the new --project <name> flag runs a single named client. Relative input/outputDir paths resolve against the config file's directory. The spec positional and --output-dir are now optional when a config file supplies them. (#32)

  • 7e51e0c: Always generate an index.ts barrel alongside contracts.ts and client.ts in the output directory — export * from './contracts.js'; plus export * from './client.js'; under the standard genoc header — so the client factory can be imported straight from the output directory. Barrel generation is always on: no flag, no config option. Regenerating overwrites all three files, including any hand-authored index.ts. A spec schema named createClient would collide with the barrel's re-exported factory, so such schemas now rename to createClientModel.

  • fb20f92: Add -o as a short alias for the --output-dir CLI flag: genoc ./spec.yaml -o ./src/api now works alongside the long form, including when overriding a config file's outputDir.

  • e3c4083: Remove the programmatic API: generateClient, loadSpec, and the root package export are gone. genoc is now CLI-only — generate clients with the genoc binary (optionally configured via .genocrc.yml / .genocrc.json). Generated code is unaffected: it imports from genoc/runtime, which remains published.

    BREAKING CHANGE: the genoc package root no longer exports anything. import { generateClient, loadSpec } from 'genoc' (and root type imports) now fail at build time — use the CLI instead, and import runtime values (ApiError, isDefinedError, Requester, …) from genoc/runtime.

Patch Changes

  • 37202b7: Resolve $refs in multipart request bodies before classifying file inputs: a $ref'd format: binary property now generates a FileInput field appended as formData.append(name, file.data, file.filename) (and a File[] loop for arrays of binaries) instead of a plain append of the unresolved object. Whole-body $refs to multipart schemas no longer silently drop all fields. Generation was also rearchitected around a single analyze() translation pass consumed by pure renderers — output for all other specs is byte-identical.
  • b234625: v3.1 spec validation now reaches parity with v3.0: schemas under components.schemas are validated recursively (including properties, items, additionalProperties, allOf/oneOf/anyOf, and prefixItems), and 3.0-only constructs are rejected with dot-joined schema paths — nullable, boolean-form exclusiveMinimum/exclusiveMaximum, and array-form items (tuples must use prefixItems). Schema-level example stays accepted: deprecated but still legal per the frozen OpenAPI 3.1.0 spec. Legal 3.1 features (type arrays, "type": "null", $schema, $ref siblings, const, examples) are explicitly not flagged.
  • 1f5c750: Classify responses and request bodies as binary when the resolved schema has format: binary — vendor content types like application/vnd.openxmlformats-officedocument.spreadsheetml.sheet now generate StreamResponse returns with expectStream: true and Blob bodies instead of a broken string contract.

0.3.0

Minor Changes

  • 7b4dd43: Add HTTP(S) proxy support for fetching OpenAPI specs from URLs: new --proxy CLI flag and proxy programmatic option; HTTP_PROXY/HTTPS_PROXY/NO_PROXY environment variables are now respected when no flag is given (previously ignored — escape hatch: NO_PROXY).

Patch Changes

  • 5ab175a: Remove the dead src/generator/error-types.ts module. generateErrorTypes was never called by the generation pipeline and had diverged from the live inline scheme (methodName-based prefixes, un-renamed tsTypes, inline ApiError classes already emitted by contracts-generator).
  • 48289eb: Handle special characters in schema names and routes: any run of non-identifier symbols (brackets, backticks, hyphens, spaces, dots, tildes, ...) is folded into PascalCase, leading digits and exact reserved words get an _ prefix, and schemas whose sanitized names collide are renamed with a Model suffix. Route-derived type prefixes and method names go through the same sanitization.

0.2.0

Minor Changes

  • f558199: Generate JSDoc documentation from OpenAPI field metadata. Field-level description, deprecated, default, example/examples, and title now flow into the generated output as JSDoc — on schema properties, query/header/body parameter types, response types, named type declarations, and client method JSDoc (lowest-numbered 2xx response description). Descriptions containing */ or newlines are now escaped/flattened instead of corrupting the generated file.

    Output format change (regeneration required): generated type tokens are provably unchanged — a stripped-comment equivalence harness verifies every type compiles identically to before — but object types now render as multi-line blocks with depth-aware indentation instead of single-line inline literals ({ id: string; name: string; } → one property per line). Generated files therefore differ textually: consumers diffing or snapshotting generated output must regenerate it. Note that JSDoc comments are preserved in tsc --declaration output, so published .d.ts text changes as well. Tag order is fixed: description → @deprecated → @default → @example(s) → @title. Composition rules: allOf parent metadata is emitted, inline oneOf/anyOf member and items/additionalProperties metadata is dropped; parameter-level metadata takes precedence over schema-level metadata on parameter types.

  • 33b378e: Remove the streamResponse() and errorResponse() factory functions from genoc/runtime. They were zero-logic wrappers around the StreamResponse and ErrorResponse constructors, so the classes are all that remain on the runtime surface.

    Breaking change: code importing streamResponse or errorResponse from genoc, genoc/runtime, or a generated contracts.ts (which no longer re-exports them) must call the constructors directly instead:

    // before
    import { streamResponse, errorResponse } from 'genoc/runtime';
    const stream = streamResponse(data, filename, headers);
    const error = errorResponse(status, data, headers, message);
    
    // after
    import { StreamResponse, ErrorResponse } from 'genoc/runtime';
    const stream = new StreamResponse(data, filename, headers);
    const error = new ErrorResponse(status, data, headers, message);

    Both constructors default headers to {}, so calls that omitted the argument keep working unchanged. All other runtime exports (StreamResponse, ErrorResponse, ApiError, UnspecifiedApiError, DefaultApiError, RequesterFailError, decorateWithErrors, isDefinedError, Requester) are unaffected.

  • 315e181: Add genoc/runtime subpath export containing the shared runtime contract: the Requester type, StreamResponse, ErrorResponse, error classes (ApiError, UnspecifiedApiError, DefaultApiError, RequesterFailError), response helpers (streamResponse, errorResponse), and isDefinedError/decorateWithErrors.

    Generated code now imports these from genoc/runtime instead of declaring inline copies (the generated contracts.ts re-exports them, so existing consumer imports keep working). This gives all generated clients a single class identity — instanceof checks work across clients and a shared Requester can be written and compiled against the package before any generation.

    Notes for consumers:

    • genoc is now a runtime dependency of generated output (previously the generated code was fully self-contained).
    • New --runtime-import-path CLI flag / runtimeImportPath programmatic config option overrides the import specifier (default genoc/runtime), e.g. [email protected]/runtime for version pinning.

0.1.3

Patch Changes

  • 418e5cd: Handle dotted contracts
  • 6dfe0dc: Remove isError utility
  • 3ba7344: Handle name collision

0.1.2

Patch Changes

  • 192cf5e: Update headers type
  • 192cf5e: Update parameters order generation: params -> query -> body -> headers

0.1.1

Patch Changes

  • 089590e: Replace errorsSymbol with a hidden errors string property to fix typescript errors ts(4023) and ts(2527)

0.1.0

Minor Changes

  • 979a37f: Initial commit
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.