From 781aca4357fe2cfc59553d4fe4443e7934bdc32f Mon Sep 17 00:00:00 2001 From: Guillaume Hillairet Date: Tue, 18 Jun 2019 11:31:17 +0200 Subject: [PATCH] [ZEN-4921] Parameter and header code assist is incomplete; style parameter should show enumerated values Added style values as enum in openapi schema. --- .../swagedit/core/assist/JsonProposalProvider.java | 2 +- .../reprezen/swagedit/openapi3/schema/schema_v3.json | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/com.reprezen.swagedit.core/src/com/reprezen/swagedit/core/assist/JsonProposalProvider.java b/com.reprezen.swagedit.core/src/com/reprezen/swagedit/core/assist/JsonProposalProvider.java index ffe2a496..99480540 100644 --- a/com.reprezen.swagedit.core/src/com/reprezen/swagedit/core/assist/JsonProposalProvider.java +++ b/com.reprezen.swagedit.core/src/com/reprezen/swagedit/core/assist/JsonProposalProvider.java @@ -212,7 +212,7 @@ protected Collection createObjectProposals(ObjectTypeDefinit protected Collection createArrayProposals(ArrayTypeDefinition type, AbstractNode node) { Collection proposals = new LinkedHashSet<>(); - if (type.itemsType.getType() == JsonType.ENUM) { + if (type.itemsType != null && type.itemsType.getType() == JsonType.ENUM) { String labelType = type.itemsType.getContainingProperty(); for (String literal : enumLiterals(type.itemsType)) { diff --git a/com.reprezen.swagedit.openapi3/src/com/reprezen/swagedit/openapi3/schema/schema_v3.json b/com.reprezen.swagedit.openapi3/src/com/reprezen/swagedit/openapi3/schema/schema_v3.json index c9276700..a8774987 100644 --- a/com.reprezen.swagedit.openapi3/src/com/reprezen/swagedit/openapi3/schema/schema_v3.json +++ b/com.reprezen.swagedit.openapi3/src/com/reprezen/swagedit/openapi3/schema/schema_v3.json @@ -416,7 +416,16 @@ "type": "boolean" }, "style": { - "type": "string" + "type": "string", + "enum": [ + "matrix", + "label", + "form", + "simple", + "spaceDelimited", + "pipeDelimited", + "deepObject" + ] }, "explode": { "type": "boolean"