You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2022/03/04 13:21:58 UTC
[GitHub] [camel] davsclaus commented on a change in pull request #7105: CAMEL-17717: REST DSL securityRequirements cleanup
davsclaus commented on a change in pull request #7105:
URL: https://github.com/apache/camel/pull/7105#discussion_r819563759
##########
File path: core/camel-core-model/src/main/java/org/apache/camel/model/rest/RestDefinition.java
##########
@@ -606,6 +619,10 @@ public RestDefinition security(String key, String scopes) {
return this;
}
+ public Collection<SecurityDefinition> securityRequirements() {
Review comment:
What is this method for?
##########
File path: core/camel-core-model/src/main/java/org/apache/camel/model/rest/RestDefinition.java
##########
@@ -170,15 +176,17 @@ public void setSecurityDefinitions(RestSecuritiesDefinition securityDefinitions)
this.securityDefinitions = securityDefinitions;
}
- public SecurityRequirementsDefinition getSecurityRequirements() {
+ public List<SecurityDefinition> getSecurityRequirements() {
return securityRequirements;
}
/**
* Sets the security requirement(s) for all endpoints.
*/
- public void setSecurityRequirements(SecurityRequirementsDefinition securityRequirements) {
- this.securityRequirements = securityRequirements;
+ public void setSecurityRequirements(Collection<SecurityDefinition> securityRequirements) {
Review comment:
The getter/setter should be same type, eg List
##########
File path: core/camel-core-model/src/main/java/org/apache/camel/model/rest/RestDefinition.java
##########
@@ -80,11 +84,13 @@
@XmlElement(name = "securityDefinitions") // use the name Swagger/OpenAPI uses
@Metadata(label = "security")
private RestSecuritiesDefinition securityDefinitions;
- @XmlElement(name = "securityRequirements") // use the name Swagger/OpenAPI uses
+ @XmlElement
@Metadata(label = "security")
- private SecurityRequirementsDefinition securityRequirements;
+ private List<SecurityDefinition> securityRequirements = new ArrayList<>();
@XmlElementRef
private List<VerbDefinition> verbs = new ArrayList<>();
+ @XmlTransient
+ private Map<String, SecurityDefinition> itemsMap = new HashMap<>();
Review comment:
Can we avoid this internal special map as this is not common practice in the model classes, so can you try to find another way.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org