Skip to content

[PJL-10221] handle some edge cases in OpenAPI v3.1 swagger generation #327

[PJL-10221] handle some edge cases in OpenAPI v3.1 swagger generation

[PJL-10221] handle some edge cases in OpenAPI v3.1 swagger generation #327

GitHub Actions / JUnit Report python3.8 marshmallow==3.17.* flask=='2.3.*' werkzeug=='2.3.*' failed Oct 2, 2024 in 0s

134 tests run, 133 passed, 0 skipped, 1 failed.

Annotations

Check failure on line 1 in TestConverterRegistry

See this annotation in the file changed.

@github-actions github-actions / JUnit Report python3.8 marshmallow==3.17.* flask=='2.3.*' werkzeug=='2.3.*'

TestConverterRegistry.test_custom_dicts_openapi_v3

TypeError: __init__() takes from 2 to 3 positional arguments but 4 were given
Raw output
self = <tests.swagger_generation.test_marshmallow_to_swagger.TestConverterRegistry testMethod=test_custom_dicts_openapi_v3>

    def test_custom_dicts_openapi_v3(self):
        for field, result in [
            (
                m.fields.Dict(),
                {
                    "type": "object",
                },
            ),
            (
                m.fields.Dict(
                    keys=m.fields.String(),
                    values=m.fields.Integer(),
                    dump_default={"a": 1},
                ),
                {
                    "type": "object",
                    "additionalProperties": {"type": "integer"},
                },
            ),
            (
                m.fields.Dict(
>                   keys=m.fields.String(validate=v.OneOf("a", "b", "c")),
                    values=m.fields.String(),
                ),
                {
                    "type": "object",
                    "additionalProperties": {"type": "string"},
                },
            ),
        ]:
E       TypeError: __init__() takes from 2 to 3 positional arguments but 4 were given

tests/swagger_generation/test_marshmallow_to_swagger.py:258: TypeError