Skip to content

Add additional properties to OpenApiConfig #2705

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

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ public String toString() {
private boolean syncCorsPreflightIntegration = false;
private ErrorStatusConflictHandlingStrategy onErrorStatusConflict;
private OpenApiVersion version = OpenApiVersion.VERSION_3_0_2;
private Map<String, Object> additionalProperties = new HashMap<>();

public OpenApiConfig() {
super();
Expand Down Expand Up @@ -375,6 +376,23 @@ public void setOnErrorStatusConflict(ErrorStatusConflictHandlingStrategy onError
this.onErrorStatusConflict = Objects.requireNonNull(onErrorStatusConflict);
}

public Map<String, Object> getAdditionalProperties() {
return Collections.unmodifiableMap(additionalProperties);
}

/**
* Sets additional non-standard config property that might be used by other components
* @param key Name of the property to put.
* @param value Value to set for the property.
*/
public void putAdditionalProperty(String key, Object value) {
this.additionalProperties.put(key, value);
}

public Object getAdditionalProperty(String key) {
return this.additionalProperties.get(key);
}

/**
* Creates an OpenApiConfig from a Node value.
*
Expand Down
Loading