Conversation
Co-authored-by: vishr <314036+vishr@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Resolve format tag conflicts with swag
Support OpenAPI date-time formats in time binding
Oct 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adding Swag's
format:"date-time"tag to atime.Timefield made Echo interpret the OpenAPI name as a Go time layout, rejecting otherwise valid RFC3339 input.This change recognizes the two OpenAPI format names for
time.Timeand*time.Timefields in path, query, header, and form binding:date-timeuses the same standard-library text decoder as an untaggedtime.Time, accepting RFC3339 timestamps withZor a numeric offset.date-time-localaccepts2006-01-02T15:04:05with optional fractional seconds and rejects timezone suffixes. Parsing assigns UTC, consistent with Echo's existing custom layouts that omit a timezone. This is an Echo parsing policy; the input itself does not specify UTC.The formats have distinct semantics in the OpenAPI registry. Other format values continue to be Go layouts. JSON/XML decoding and custom unmarshaler dispatch retain their existing behavior; slice elements retain their existing format-tag behavior.
Validation:
go test -race --coverprofile=coverage.coverprofile --covermode=atomic ./...go vet ./...Fixes #3107