Marco Carletti created CAMEL-21692:
--------------------------------------
Summary: camel-jbang: using mock in openapi contract first
approach won't work anymore
Key: CAMEL-21692
URL: https://issues.apache.org/jira/browse/CAMEL-21692
Project: Camel
Issue Type: Bug
Components: camel-jbang
Affects Versions: 4.9.0, 4.10.0
Environment:
{code:bash}
$ camel version
JBang version: 0.123.0
Camel JBang version: 4.9.0
$ cat .camel-jbang/camel-jbang-run.properties
loggingLevel=info
loggingColor=true
loggingJson=false
camel.main.modeline=true
camel.jbang.compileWorkDir=.camel-jbang/compile
camel.jbang.health=false
camel.jbang.metrics=false
camel.jbang.console=false
camel.jbang.verbose=false
camel.jbang.camel-version=4.9.0
camel.jbang.springBootVersion=3.4.0
camel.jbang.quarkusVersion=3.16.4
camel.jbang.quarkusGroupId=io.quarkus.platform
camel.jbang.quarkusArtifactId=quarkus-bom
camel.jbang.kameletsVersion=4.9.0
camel.main.name=petstore
camel.main.routesIncludePattern=file\:petstore.camel.yaml
camel.jbang.classpathFiles=petstore-v3.json
dependency=mvn\:org.apache.camel\:camel-kamelet\:4.9.0
dependency=mvn\:org.apache.camel\:camel-yaml-dsl\:4.9.0
dependency=mvn\:org.apache.camel\:camel-core-languages\:4.9.0
dependency=mvn\:org.apache.camel\:camel-rest\:4.9.0
dependency=mvn\:org.apache.camel\:camel-rest-openapi\:4.9.0
dependency=mvn\:org.apache.camel\:camel-openapi-java\:4.9.0
dependency=mvn\:org.apache.camel\:camel-jackson\:4.9.0
dependency=mvn\:org.apache.camel\:camel-platform-http\:4.9.0
camel.jbang.platform-http.port=8080
{code}
Reporter: Marco Carletti
Running the [open-api-contract-first
example|https://github.com/apache/camel-kamelets-examples/tree/main/jbang/open-api-contract-first]
as explained in the README file won't work
# get the code: git clone [email protected]:apache/camel-kamelets-examples
--depth=1 && cd camel-kamelets-examples/jbang/open-api-contract-first
# run application: camel run petstore-v3.json petstore.camel.yaml
# in a new terminal run the http request: curl -i
http://localhost:8080/api/v3/pet/123
this is the response (with unexpected body):
{code:bash}
$ curl -i http://localhost:8080/api/v3/pet/123
HTTP/1.1 200 OK
petId: 123
transfer-encoding: chunked
Content-Type: application/json
{"pet": "jack the cat"}
{code}
the response expected contains the body from the mock so
{code:json}
{
"pet": "donald the dock"
}
{code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)