Checklist
Description
RolesClient {
public SyncPagingIterable<Role> list(ListRolesRequestParameters request) {
return this.rawClient.list(request).body();
}
public GetRoleResponseContent get(String id) {
return this.rawClient.get(id).body();
}
public CreateRoleResponseContent create(CreateRoleRequestContent request) {
return this.rawClient.create(request).body();
}
}
Duplicate generated model classes.
The generated SDK appears to create separate model classes for list, get and create operations, even when they represent the same resource and contain identical properties.
For example, a list() operation may return a Role model, while the corresponding get() operation returns a GetRoleResponseContent model, despite both models appearing to be structurally identical.
Using different model classes for the same resource makes the SDK inconsistent and adds unnecessary complexity for consumers. It would be preferable to reuse the same model type across operations whenever the underlying schemas are equivalent.
public final class Role {
private final Optional<String> id;
private final Optional<String> name;
private final Optional<String> description;
private final Map<String, Object> additionalProperties;
}
public final class GetRoleResponseContent{
private final Optional<String> id;
private final Optional<String> name;
private final Optional<String> description;
private final Map<String, Object> additionalProperties;
}
public final class CreateRoleResponseContent {
private final Optional<String> id;
private final Optional<String> name;
private final Optional<String> description;
private final Map<String, Object> additionalProperties;
}
Fields such as id and name are required by the API, yet they are generated as Optional. This is misleading and results in unnecessary code such as role.getId().get(), while IDEs still warn that the value may be absent.
Reproduction
Additional context
No response
auth0-java version
3.10.0
Java version
21.0.1
Checklist
Description
Duplicate generated model classes.
The generated SDK appears to create separate model classes for list, get and create operations, even when they represent the same resource and contain identical properties.
For example, a list() operation may return a Role model, while the corresponding get() operation returns a GetRoleResponseContent model, despite both models appearing to be structurally identical.
Using different model classes for the same resource makes the SDK inconsistent and adds unnecessary complexity for consumers. It would be preferable to reuse the same model type across operations whenever the underlying schemas are equivalent.
Fields such as id and name are required by the API, yet they are generated as Optional. This is misleading and results in unnecessary code such as role.getId().get(), while IDEs still warn that the value may be absent.
Reproduction
Additional context
No response
auth0-java version
3.10.0
Java version
21.0.1