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

spectral rules looks not working correctly #369

Closed
LasneF opened this issue Nov 15, 2023 · 1 comment
Closed

spectral rules looks not working correctly #369

LasneF opened this issue Nov 15, 2023 · 1 comment
Labels
bug Something isn't working needs investigation

Comments

@LasneF
Copy link

LasneF commented Nov 15, 2023

given the spectral rules like this

openapi-v3-schema-properties-names-camel-case:
description: Ensuring that schema property names are camel case.
message: All schema property names should be camel case.
severity: warn
given: "$..properties"
then:
function: casing
functionOptions:
type: camel

when i launch it against my API is raises such error


Line / Column | Severity | Message                                                                    | Rule                                          | Path
(53:9)        | warning  | Ensuring that schema property names are camel case.: '' is not camel case! | openapi-v3-schema-properties-names-camel-case | $..properties
(53:9)        | warning  | Ensuring that schema property names are camel case.: '' is not camel case! | openapi-v3-schema-properties-names-camel-case | $..properties
(53:9)        | warning  | Ensuring that schema property names are camel case.: '' is not camel case! | openapi-v3-schema-properties-names-camel-case | $..properties
(53:9)        | warning  | Ensuring that schema property names are camel case.: '' is not camel case! | openapi-v3-schema-properties-names-camel-case | $..properties
(53:9)        | warning  | Ensuring that schema property names are camel case.: '' is not camel case! | openapi-v3-schema-properties-names-camel-case | $..properties
(53:9)        | warning  | Ensuring that schema property names are camel case.: '' is not camel case! | openapi-v3-schema-properties-names-camel-case | $..properties
(53:9)        | warning  | Ensuring that schema property names are camel case.: '' is not camel case! | openapi-v3-schema-properties-names-camel-case | $..properties
(53:9)        | warning  | Ensuring that schema property names are camel case.: '' is not camel case! | openapi-v3-schema-properties-names-camel-case | $..properties
(53:9)        | warning  | Ensuring that schema property names are camel case.: '' is not camel case! | openapi-v3-schema-properties-names-camel-case | $..properties
(53:9)        | warning  | Ensuring that schema property names are camel case.: '' is not camel case! | openapi-v3-schema-properties-names-camel-case | $..properties
(53:9)        | warning  | Ensuring that schema property names are camel case.: '' is not camel case! | openapi-v3-schema-properties-names-camel-case | $..properties
(61:15)       | warning  | Ensuring that schema property names are camel case.: '' is not camel case! | openapi-v3-schema-properties-names-camel-case | $..properties
(61:15)       | warning  | Ensuring that schema property names are camel case.: '' is not camel case! | openapi-v3-schema-properties-names-camel-case | $..properties
(61:15)       | warning  | Ensuring that schema property names are camel case.: '' is not camel case! | openapi-v3-schema-properties-names-camel-case | $..properties
(61:15)       | warning  | Ensuring that schema property names are camel case.: '' is not camel case! | openapi-v3-schema-properties-names-camel-case | $..properties
(61:15)       | warning  | Ensuring that schema property names are camel case.: '' is not camel case! | openapi-v3-schema-properties-names-camel-case | $..properties
(61:15)       | warning  | Ensuring that schema property names are camel case.: '' is not camel case! | openapi-v3-schema-properties-names-camel-case | $..properties
(61:15)       | warning  | Ensuring that schema property names are camel case.: '' is not camel case! | openapi-v3-schema-properties-names-camel-case | $..properties
(61:15)       | warning  | Ensuring that schema property names are camel case.: '' is not camel case! | openapi-v3-schema-properties-names-camel-case | $..properties
(61:15)       | warning  | Ensuring that schema property names are camel case.: '' is not camel case! | openapi-v3-schema-properties-names-camel-case | $..properties
(61:15)       | warning  | Ensuring that schema property names are camel case.: '' is not camel case! | openapi-v3-schema-properties-names-camel-case | $..properties
(61:15)       | warning  | Ensuring that schema property names are camel case.: '' is not camel case! | openapi-v3-schema-properties-names-camel-case | $..properties
(93:9)        | warning  | Ensuring that schema property names are camel case.: '' is not camel case! | openapi-v3-schema-properties-names-camel-case | $..properties
(93:9)        | warning  | Ensuring that schema property names are camel case.: '' is not camel case! | openapi-v3-schema-properties-names-camel-case | $..properties

toto.txt

@daveshanley daveshanley added bug Something isn't working needs investigation labels Nov 15, 2023
@daveshanley daveshanley mentioned this issue Nov 17, 2023
@daveshanley
Copy link
Owner

Fixed in version v0.5.0

The following ruleset

rules:
  openapi-v3-schema-properties-names-camel-case:
    description: Ensuring that schema property names are camel case
    message: All schema property names should be camel case
    severity: warn
    given: "$..properties"
    then:
      function: casing
      functionOptions:
        type: camel

Combined with the supplied specification in toto.txt Now results in the following output.

Screenshot 2023-11-18 at 9 19 48 AM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs investigation
Projects
None yet
Development

No branches or pull requests

2 participants