spectral icon indicating copy to clipboard operation
spectral copied to clipboard

AsyncAPI - Add rule to check object keys in fixed fields

Open Amzani opened this issue 2 years ago • 0 comments

Chore summary

As a user I want to know if all the fixed fields are objects that MUST use keys that match the regular expression: ^[a-zA-Z0-9.-_]+$

https://www.asyncapi.com/docs/reference/specification/v2.6.0#componentsObject

Currently spectral trigger only an asyncapi-document-unresolved error

Example of an invalid asyncAPI file: https://gist.github.com/Amzani/7df1d67d7eb665bdc7a2a5dd7e794e0c

Tasks

  • [ ] send a new error to match ^[a-zA-Z0-9\.\-_]+$ regular expression requirement

Additional context

  • https://github.com/asyncapi/studio/issues/728
  • https://github.com/stoplightio/spectral/issues/2100

Amzani avatar Jul 11 '23 08:07 Amzani