Apicurio / apicurio-studio

Open Source API Design
https://www.apicur.io/studio/
Apache License 2.0
987 stars 498 forks source link

Import data types from different API sources having the same name #1953

Open wuwu2000 opened 2 years ago

wuwu2000 commented 2 years ago

Hi, I have let's say 3 projects. Project A and project B have a data type named "person". In project C I want to import them both. Now There is a naming conflict. In this case I would be able to rename the imported types.

But let's say if project A has data type APersons with property person (data type person) and project B has data BPersons with property person (data type person). I import APersons and BPersons in project C. Now I have a naming conflict I can't resolve. Is there a way to give let's say all transitive dependencies a prefix?

If I download the spec "Download API Spec as-is" I don't know how to use these references with my spring-openapi processor (like what is apicurio # 4?).

EricWittmann commented 2 years ago

This is an interesting edge case for automatic dereferencing of $ref refs, @jsenko

I would need to analyze this a bit more, but it feels like something that can be addressed. The suggestion of automatically prefixing types imported from a transitive dependency makes a lot of sense. The names of the imported types shouldn't matter, I don't think, as long as the references are properly set.