microcks / microcks-spectral-ruleset

A set of rules for Spectral that allows linting OpenAPI and AsyncAPI spec for Microcks conventions
https://microcks.io
Apache License 2.0
7 stars 2 forks source link

OpenAPI operations with no input raise errors #10

Closed lbroudoux closed 3 months ago

lbroudoux commented 3 months ago

Describe the bug

Let's say we have a simple GET /forecasts operations that take no input parameters, it raises an error because it founds no example fragment for inputs. The OpenAPI file is correctmly imported into Microcks and produces functional mock though.

$ spectral lint -r microcks-rules.yaml resources/weather-forecast-openapi.yaml

/Users/laurent/Development/github/microcks-spectral-ruleset/resources/weather-forecast-openapi.yaml
 26:17  warning  microcks-examples-fragments-to-complete-mocks  🚨 Response example 'all' is incomplete, it has no matching input example. It requires at least one requestBody or parameter example with same name to be considered as valid mock for Microcks.  paths./forecast.get.responses

✖ 1 problem (0 errors, 1 warning, 0 infos, 0 hints)

Expected behavior

Spectral linting should no raise errors on that case.

Actual behavior

See above.

How to Reproduce?

See above.

Microcks version or git rev

No response

Install method (docker-compose, helm chart, operator, docker-desktop extension,...)

No response

Additional information

The same applies when using Vacuum