manuzhang commented on code in PR #15331:
URL: https://github.com/apache/iceberg/pull/15331#discussion_r2811275561
##########
open-api/rest-catalog-open-api.py:
##########
@@ -136,11 +136,59 @@ class ExpressionType(BaseModel):
class TrueExpression(BaseModel):
- type: Literal['true'] = Field('true', const=True)
+ type: Literal['true'] = Field(
+ 'true',
+ const=True,
+ example=[
+ 'true',
+ 'false',
Review Comment:
@Fokko I passed down your comment to claude. Here's its reply, which looks
valid after checking
https://github.com/koxudaxi/datamodel-code-generator/releases/tag/0.54.0
```
I see the issue! In the OpenAPI spec at line 2377, TrueExpression.type has
both:
1. A $ref to ExpressionType (which has examples of ALL expression types)
2. A const: "true" constraint
The new version of datamodel-code-generator (0.54.0) is now pulling in the
examples from the referenced ExpressionType schema, even though the field is
constrained to only "true". This is technically
correct from the OpenAPI spec's perspective, but confusing for the
generated code.
This seems like a regression or at least an awkward behavior change in
v0.54.0. The examples should probably only show 'true' for TrueExpression, not
all possible expression types.
Would you like me to:
1. Revert to version 0.53.0 to avoid this issue?
2. File an issue with the OpenAPI spec to fix the schema definition?
3. Accept this as-is since it matches what's technically in the spec?
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]