davsclaus opened a new pull request, #28043:
URL: https://github.com/apache/camel/pull/28043
CAMEL-25747: camel-rest-openapi loaded the specification with the swagger
parser but dropped the messages in the parse result. The parser ignores the
parts it cannot read, so a mistake in the contract left no trace in the log.
In the overnight benchmark of Oct 17-18 (see CAMEL-25746), a local model
nested `"/stock/{sku}"` inside the `"/stock"` path item. The parser reports
`attribute paths.'/stock'./stock/{sku} is unexpected` and ignores the nested
path. The contract-first Rest DSL started, but `GET /stock/A1` answered 404,
and the log said nothing.
## What
- **A WARN with the parser messages** when the specification is loaded.
`loadSpecificationFrom` serves both the consumer (the contract-first Rest DSL)
and the producer:
`The OpenAPI specification nested-path.json has problems, and the parser
ignores the parts it cannot read: attribute paths.'/stock'./stock/{sku} is
unexpected`
- **The exception includes the messages** when the parser cannot read the
specification at all. A Swagger 2.0 document now gives `Could not deserialize
OpenAPI specification from: openapi.json (attribute openapi is missing)`.
Before, it said only the first part.
## Tests
- `RestOpenApiSpecificationProblemsTest` (new): the nested path is logged as
a WARN, a valid specification logs nothing, and the exception for a Swagger 2.0
document names the missing attribute.
- All camel-rest-openapi tests pass (186).
- Two existing test specifications now log the WARN, and both have real
mistakes: `fruits-3.0.yaml` has an array parameter without `items`, and
`missing-opid.yaml` has Swagger 2.0 style parameters (`type` and `format`
without a `schema`). The tests do not depend on these parts, so I left the
files as they are.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01STT6whBgK1AqsSsUKrnE8m
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]