Package dk.mada.jaxrs.openapi
Class ConflictRenamer
java.lang.Object
dk.mada.jaxrs.openapi.ConflictRenamer
Renames types to avoid on-disk conflicts.
It changes the name of DTOs and adds renaming mapping to the TypeNames so the generators will get the new names.
The MP @Schema name is also changed, using its own namespace. This is needed to avoid @Schema declaring a different
name than that assigned to the DTO. May need a separate switch.
-
Constructor Summary
ConstructorDescriptionConflictRenamer
(TypeNames typeNames, Naming naming, List<String> schemaNamesDeclarationOrder) Constructs a new instance. -
Method Summary
Modifier and TypeMethodDescriptiongetConflictRenamedDto
(Dto dto) Maps pre-renamed DTO instance to new (possibly renamed) instance.resolveNameConflicts
(Collection<Dto> dtos) Resolves name conflicts in DTOs.
-
Constructor Details
-
Method Details
-
resolveNameConflicts
Resolves name conflicts in DTOs. Returns new DTO instances that have been renamed. References in their properties have *not* been resolved.- Parameters:
dtos
- the DTOs to rename- Returns:
- the renamed DTOs
-
getConflictRenamedDto
Maps pre-renamed DTO instance to new (possibly renamed) instance.- Parameters:
dto
- pre-renamed DTO- Returns:
- same DTO instance, but renamed if required
-