Skip to content

Commit

Permalink
Remove xfail for discriminated union with alias (#6938)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmontagu committed Jul 29, 2023
1 parent bb43605 commit 66038be
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions tests/test_json_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -3893,7 +3893,6 @@ class Model(BaseModel):
}


@pytest.mark.xfail(reason='json schema generation for tagged unions is fundamentally incompatible with references')
def test_alias_same():
class Cat(BaseModel):
pet_type: Literal['cat'] = Field(alias='typeOfPet')
Expand Down Expand Up @@ -3934,7 +3933,7 @@ class Model(BaseModel):
'pet': {
'oneOf': [{'$ref': '#/$defs/Cat'}, {'$ref': '#/$defs/Dog'}],
'title': 'Pet',
'discriminator': 'something',
'discriminator': {'mapping': {'cat': '#/$defs/Cat', 'dog': '#/$defs/Dog'}, 'propertyName': 'typeOfPet'},
},
},
'required': ['pet', 'number'],
Expand Down

0 comments on commit 66038be

Please sign in to comment.