Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: go-openapi/codescan
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.36.0
Choose a base ref
...
head repository: go-openapi/codescan
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.36.1
Choose a head ref
  • 5 commits
  • 39 files changed
  • 3 contributors

Commits on Jul 31, 2026

  1. chore: removed replace to release cmd/genspec-tui

    Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
    fredbi committed Jul 31, 2026
    Configuration menu
    Copy the full SHA
    8e25fe2 View commit details
    Browse the repository at this point in the history

Commits on Aug 1, 2026

  1. doc: updated contributors file

    Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
    bot-go-openapi[bot] authored and github-actions[bot] committed Aug 1, 2026
    Configuration menu
    Copy the full SHA
    354fe10 View commit details
    Browse the repository at this point in the history
  2. fix(scanner): stop dropping negative and computed swagger:enum members

    Both the members of a swagger:enum and the type of the schema carrying them were
    derived from the literal syntax of the const block. Neither survives that reading
    intact: a constant's right-hand side is only incidentally a literal, and a value
    carries no trace of the width it was declared with.
    
    Members:
    - a signed constant (-1) is a unary expression, not a literal, and was skipped,
      so an enum straddling zero lost half its members;
    - the non-decimal forms (0x2a, 0b101010, 0o52) and digit separators failed a
      base-10 parse and reached the spec as a null member; a value above MaxInt64,
      legal for a uint64 enum, was dropped;
    - iota, constant expressions, references to earlier members, rune literals,
      true/false and the raw string form were invisible, since their value is not in
      their syntax and inside an iota block only the first spec carries a type at
      all. Members now come from the type-checker, which evaluated them exactly, and
      membership is decided per name from the constant's own type — the package
      included, so a same-named imported type is not swallowed.
    
    The literal reader survives as the fallback for a package that only partially
    type-checks, where an annotated enum should still contribute what can be read.
    
    Typing:
    - type and format come from the declared Go type rather than from the first
      value's Go representation: an int8 enum is {integer, int8}, a float32 one
      {number, float}. Every width used to collapse, and the declaration order of
      the const block decided the type — a float enum whose first member was written
      `= 0` emitted {type: integer} carrying fractional members;
    - each member is normalised to that type, and one that cannot be represented in
      it is reported and dropped rather than written against the schema's own type;
    - a type declared over another named type (type Kind strfmt.UUID) keeps the
      format of the type it is written over, which Underlying() does not carry.
    
    An enum built from iota, booleans or expressions used to emit nothing plus a "no
    matching const values found" warning; it now emits its values.
    
    A rune or byte enum is among those newly emitted, and it emits an integer enum:
    `const LetterA Letter = 'a'` becomes {integer, int32} with the member 97. That
    is likely not what its author pictured, and it is still the only faithful
    answer — a scalar rune is an int32 on the wire, and encoding/json refuses to
    unmarshal "a" into that field. Declaring the type over string is what changes
    the wire, and with it the schema.
    
    No existing golden changes: the corpus held no enum that was negative, sized,
    iota-based or strfmt-backed, which is why none of this was visible.
    
    Refers to go-swagger/go-swagger#3412.
    
    Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
    Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
    fredbi and claude committed Aug 1, 2026
    Configuration menu
    Copy the full SHA
    9eff0a4 View commit details
    Browse the repository at this point in the history
  3. docs(doc-site): give enums their own tutorial page

    The enum section under "Model definitions" covered a string const block and
    little else. Enums get their own page, next to it in the tutorial order: what
    the scanner collects (any constant expression, iota included), what decides the
    emitted type and format, the inline form parameters and headers take, and the
    two shapes that do not work — a rune or byte enum, which emits code points
    because that is what those types are on the wire, and an alias to a basic type,
    which the type-checker erases before there is anything left to collect.
    
    A new docs/examples/concepts/enums package backs the panes, one region per rule,
    its fragments regenerated as goldens like the other tutorials.
    
    Model definitions keeps its introductory pane and points at the new page; the
    annotation index and the swagger:enum reference follow.
    
    Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
    Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
    fredbi and claude committed Aug 1, 2026
    Configuration menu
    Copy the full SHA
    7afe0e3 View commit details
    Browse the repository at this point in the history
  4. Merge pull request #76 from fredbi/fix/3412-enum-negative

    Fix/3412 enum negative
    fredbi authored Aug 1, 2026
    Configuration menu
    Copy the full SHA
    c37d503 View commit details
    Browse the repository at this point in the history
Loading
⌂ 换网址