Skip to content

Commit

Permalink
fix: disable read-only validations
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Sagi-Kazar <[email protected]>
  • Loading branch information
sagikazarmark committed Oct 2, 2024
1 parent af66fb1 commit 0f17d09
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions openmeter/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ func NewServer(config *Config) (*Server, error) {
// Unfortunately, the OpenAPI 3 filter library doesn't support context changes
AuthenticationFunc: openapi3filter.NoopAuthenticationFunc,
SkipSettingDefaults: true,

// Excluding read-only validation because required and readOnly fields in our Go models are translated to non-nil fields, leading to a zero-value being passed to the API
// The OpenAPI spec says read-only fields SHOULD NOT be sent in requests, so technically it should be fine, hence disabling validation for now to make our life easier
ExcludeReadOnlyValidations: true,
},
}),
},
Expand Down

0 comments on commit 0f17d09

Please sign in to comment.