Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid type are not detected as error #411

Closed
LasneF opened this issue Jan 8, 2024 · 2 comments
Closed

Invalid type are not detected as error #411

LasneF opened this issue Jan 8, 2024 · 2 comments

Comments

@LasneF
Copy link

LasneF commented Jan 8, 2024

given the API spec below

the type : jojo should have been spot as an error , but looks not spot

version
leveraging Vaccum online

{
    "openapi": "3.1.0",
    "info": {
        "title": "this is the title",
        "description": "this is the description",
        "version": "1.0"
    },
    "servers": [
        {
            "url": "https://api.server.test/v1"
        }
    ],
    "paths": {
        "/test": {
            "get": {
                "operationId": "getTest",
                "responses": {
                    "200": {
                        "description": "testOK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Pet"
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "Pet": {
                "type": "jojo"
            }
        }
    }
}
@daveshanley
Copy link
Owner

strange, will investigate.

@daveshanley
Copy link
Owner

This has been fixed in v0.8.0 with the introduction of a new rule oas-schema-check. It will perform a type check and perform basic validation on that type compared with other properties on the schema.

Docs are here: https://quobix.com/vacuum/rules/schemas/oas-schema-check/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants