microcks: OpenApi Overriden and duplicated exemples
Describe the bug
When loading https://gitlab.com/api/v4/projects/53591717/repository/files/complex-example-2%2Fopenapi.yaml/raw?head=main
The exemples are duplicated and Overriden.
Here we can see that the Mock response for /owner/0 and /owner/0/car are the same.
Expected behavior
/owner/0/car should return
[
{ "model": "BMW X5", "year": 2018 },
{ "model": "Tesla Model 3", "year": 2020 },
]
from the exemple
summary: Laurent's Cars
value:
[
{ "model": "BMW X5", "year": 2018 },
{ "model": "Tesla Model 3", "year": 2020 },
]
Actual behavior
but Returns the same exemple as /owner/0
How to Reproduce?
- import https://gitlab.com/api/v4/projects/53591717/repository/files/complex-example-2%2Fopenapi.yaml/raw?head=main with importer
- go to the Service
Microcks version or git rev
docker.io/microcks/microcks:nightly@sha256:22eef53ce58777d07340b9a1fadccdf356f45a034034c208f8d996cb0330cfe1
Install method (docker-compose, helm chart, operator, docker-desktop extension,…)
docker-compose
Additional information
No response
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 17 (17 by maintainers)
Commits related to this issue
- fiw: #1037 Fix collision when download ref with same relative path but different absolute URL Signed-off-by: Laurent Broudoux <laurent.broudoux@gmail.com> — committed to microcks/microcks by lbroudoux 3 years ago
- fix: #1037 Safely manage reference with no / Signed-off-by: Laurent Broudoux <laurent.broudoux@gmail.com> — committed to microcks/microcks by lbroudoux 3 years ago
- fiw: #1037 Fix collision when download ref with same relative path but different absolute URL Signed-off-by: Laurent Broudoux <laurent.broudoux@gmail.com> Signed-off-by: Appadoo Apoorva Srinivas <apo... — committed to Orange-OpenSource/microcks by lbroudoux 3 years ago
- fix: #1037 Safely manage reference with no / Signed-off-by: Laurent Broudoux <laurent.broudoux@gmail.com> Signed-off-by: Appadoo Apoorva Srinivas <apoorva.appadoo@orange.com> — committed to Orange-OpenSource/microcks by lbroudoux 3 years ago
I found when it happens. It happens when a ref dosen’t have “/” in it.
For exemple there are two files like this
and in file2.yaml we have a ref like this: $ref: “file1.yaml”.
bug at line 160 in file webapp/src/main/java/io/github/microcks/util/AbstractJsonRepositoryImporter.java
baseContext = “baseContext” ref = “file1.yaml”
which does not have a /
Not at the moment. Will be for next release 😉
Oops… good catch. Will wait before launching the release process 🤞
@lbroudoux Github is currently dying https://www.githubstatus.com/ . You should probably wait before releasing
Everything else looks OK for me
Will replace it with:
This is a side effect of #1035. Will fix it asap.