Repository navigation
Comparing changes
Open a pull request
base repository: go-openapi/codescan
base: v0.36.0
head repository: go-openapi/codescan
compare: v0.36.1
- 5 commits
- 39 files changed
- 3 contributors
Commits on Jul 31, 2026
-
chore: removed replace to release cmd/genspec-tui
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
Configuration menu - View commit details
-
Copy full SHA for 8e25fe2 - Browse repository at this point
Copy the full SHA 8e25fe2View commit details
Commits on Aug 1, 2026
-
doc: updated contributors file
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Configuration menu - View commit details
-
Copy full SHA for 354fe10 - Browse repository at this point
Copy the full SHA 354fe10View commit details -
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>Configuration menu - View commit details
-
Copy full SHA for 9eff0a4 - Browse repository at this point
Copy the full SHA 9eff0a4View commit details -
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>
Configuration menu - View commit details
-
Copy full SHA for 7afe0e3 - Browse repository at this point
Copy the full SHA 7afe0e3View commit details -
Merge pull request #76 from fredbi/fix/3412-enum-negative
Fix/3412 enum negative
Configuration menu - View commit details
-
Copy full SHA for c37d503 - Browse repository at this point
Copy the full SHA c37d503View commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff v0.36.0...v0.36.1