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

[ZEN-4921] Parameter and header code assist is incomplete; style parameter should show enumerated values #505

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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 @@ -212,7 +212,7 @@ protected Collection<ProposalDescriptor> createObjectProposals(ObjectTypeDefinit
protected Collection<ProposalDescriptor> createArrayProposals(ArrayTypeDefinition type, AbstractNode node) {
Collection<ProposalDescriptor> 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)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,16 @@
"type": "boolean"
},
"style": {
"type": "string"
"type": "string",
"enum": [
"matrix",
"label",
"form",
"simple",
"spaceDelimited",
"pipeDelimited",
"deepObject"
]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The style property also applies to header (see Header Object) and encoding (Encoding Object). I think it makes sense to extract this string enum type as its own styleEnum schema, and reference that schema from all three contexts.

},
"explode": {
"type": "boolean"
Expand Down