Tishj opened a new issue, #13305:
URL: https://github.com/apache/iceberg/issues/13305

   ### Apache Iceberg version
   
   1.9.1 (latest release)
   
   ### Query engine
   
   None
   
   ### Please describe the bug 🐞
   
   There is a `discriminator`, but no accompanying `oneOf` or `anyOf` directive.
   ```yml
       TableRequirement:
         type: object
         discriminator:
           propertyName: type
           mapping:
             assert-create: '#/components/schemas/AssertCreate'
             assert-table-uuid: '#/components/schemas/AssertTableUUID'
             assert-ref-snapshot-id: '#/components/schemas/AssertRefSnapshotId'
             assert-last-assigned-field-id: 
'#/components/schemas/AssertLastAssignedFieldId'
             assert-current-schema-id: 
'#/components/schemas/AssertCurrentSchemaId'
             assert-last-assigned-partition-id: 
'#/components/schemas/AssertLastAssignedPartitionId'
             assert-default-spec-id: '#/components/schemas/AssertDefaultSpecId'
             assert-default-sort-order-id: 
'#/components/schemas/AssertDefaultSortOrderId'
         properties:
           type:
             type: string
         required:
           - type
   ```
   
   To me this looks like it violates this rule defined in the 
[spec](https://swagger.io/specification/) under "Discriminator Object":
   > Note that discriminator MUST NOT change the validation outcome of the 
schema.
   
   As such, this object has a single field `type`, because there is no 
directive to change the shape of the schema, `discriminator` can't change the 
schema, it can only provide a hint for more efficient discovery of the matching 
variant (referencing an item of the `oneOf`, `anyOf`)
   
   ### Willingness to contribute
   
   - [ ] I can contribute a fix for this bug independently
   - [ ] I would be willing to contribute a fix for this bug with guidance from 
the Iceberg community
   - [x] I cannot contribute a fix for this bug at this time


-- 
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: issues-unsubscr...@iceberg.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to