-
Notifications
You must be signed in to change notification settings - Fork 271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement dereference functionality #2865
Comments
may i ask when this feature will be implemented? we plan use debezium with |
Unfortunately, there is no timeframe for it. It's for sure on our backlog and we're working on a wide range of improvements for our artifact references support, but we have no dates yet, |
I would like to start working on this soon. @MikeEdgar this is the motivation for migrating/porting the dereference support in apicurio-data-models. But we will need to do the same for the other types we support (Avro, Protobuf, JSON Schema). |
Hi, is the I am following the example from the user documentation and I can not find an endpoint that returns a schema with resolved references when the query parameter
|
@seb-pereira I found the same , I upgraded to 2.5.9 which says it has support for dereference for Avro but this rest end point does not resolve at that level either. @EricWittmann @carlesarnal please could you review |
I just re-tested this and I get the expected result. I have a few artifacts registered, each with the expected references, for instance, I'm using the example here. If I let the maven-plugin do the registration for me, this results in 4 artifacts created:
If I get the content of TradeRaw straight, I get the expected result, the original content of the artifact in the filesystem: With this path (artifactId, the result by globalId is the same)
Now, if I try to get the content dereferenced using the same endpoint but with dereference set to true, the result is the expected one, the content dereferenced (nested records inlined):
Note that for this to happen, all the references have to be appropriately registered in the server. In this context, appropriately registered means that, if I hit the following endpoint for the TradeRaw artifact, I will see the references to the other two artifacts:
If you give me a more concrete example, I will happily test it, but to me it seems it's working as expected. |
@carlesarnal thanks for your quick response. Can I check what level we need to be on? I assume 2.5.9. |
@carlesarnal I notice the apicurio-registry-examples repository has been archived. Does this mean it will not be worked on going forward? |
Yes, the error makes sense since the examples repository is not updated. You can update the Apicurio Registry version there to |
The repository itself no, the examples will for sure continue, you got us in the middle of the Apicurio Registry 3 preparation, and one of the changes is the move of the examples from that repository to the main one, here (there is a note in the readme). I have not pointed you there because Apicurio Registry 3 has not been released yet, so the main branch is a bit unstable right now. |
@carlesarnal I tried to follow https://www.apicur.io/registry/docs/apicurio-registry/2.5.x/getting-started/assembly-managing-registry-artifacts-api.html. I then issue the rest calls:
As @seb-pereira indicated the endpoint for dereference=true is not there for me. I am running: |
@carlesarnal I tried and get |
Ok, I have figured out what's going on. The query parameter has to be escaped for it to work, so if you issue this command you should be all set -> curl http://localhost:8080/apis/registry/v2/ids/globalIds/2\?dereference\=true. |
Sorry, yes, we introduced that parameter and, as I said the example is outdated (and updated on main, but pointing to 3.0). You can fix that problem by adding a line like this to the pom -> https://github.com/Apicurio/apicurio-registry/blob/main/examples/avro-maven-with-references-auto/pom.xml#L44 |
@carlesarnal thankyou with escaping it works for me :-) This is a great circumvention - we need to change the API so that we do not need to escape to add query parameters. Do you know why this is happening? Do you need a new issue for this? @seb-pereira it looks like we have a way to get the dereferenced schema. |
Sorry, maybe my previous message was not 100% clear. I don't think the API has to change, it's a straight query parameter, it just don't work using curl if the url is not properly encoded, you can either escape it as in my previous message or you can also quote the path and it will just work |
@carlesarnal even better! I agree that updating the docs would have helped me. |
@carlesarnal @davidradl thanks for your responses. the |
With Apicurio Registry 2.5.11.Final we have introduced dereferencing support for JSON Schema, OpenAPI and AsynAPI. Now we have support for all the types we think it makes sense. Closing this as the result. |
Implement the dereference parameter support in the API. This support will be gradual since the dereference support is specific for each artifact type.
The text was updated successfully, but these errors were encountered: