Skip to content
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

PAYARA-3466 Open API 1.1 #3827

Merged
merged 10 commits into from Mar 19, 2019

PAYARA-3466 FIXED Extensible no longer adds node 'extensions' to JSON

  • Loading branch information...
jbee committed Mar 15, 2019
commit 849ff1bb8d83861a49ef113a472f33c703b5d8c8
@@ -51,13 +51,15 @@
import org.eclipse.microprofile.openapi.annotations.extensions.Extension;
import org.eclipse.microprofile.openapi.models.Extensible;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;

public abstract class ExtensibleImpl<T extends Extensible<T>> implements Extensible<T> {

private static final Logger LOGGER = Logger.getLogger(ExtensibleImpl.class.getName());

@JsonIgnore
protected Map<String, Object> extensions = new LinkedHashMap<>();

@Override
@@ -6,9 +6,12 @@

import org.eclipse.microprofile.openapi.models.Extensible;

import com.fasterxml.jackson.annotation.JsonIgnore;

public abstract class ExtensibleTreeMap<V, T extends Extensible<T>> extends TreeMap<String, V>
implements Extensible<T> {

@JsonIgnore
protected Map<String, Object> extensions = new LinkedHashMap<>();

protected ExtensibleTreeMap() {
@@ -32,7 +35,7 @@ public final void setExtensions(Map<String, Object> extensions) {
@SuppressWarnings("unchecked")
@Override
public final T addExtension(String name, Object value) {
if (value != null) {
if (value != null && name.startsWith("x-")) {
this.extensions.put(name, value);
}
return (T) this;
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.