I noted that there is a content assist proposal _key_ present in responses > content > schema. Not sure why it is there.
Test added in 0baa0ab
It happens because
We are combining all subtype contest assist proposals for a complex type, see com.reprezen.swagedit.core.assist.JsonProposalProvider.createComplextTypeProposals(ComplexTypeDefinition, AbstractNode, String):
for (TypeDefinition definition : type.getComplexTypes()) {
proposals.addAll(getProposals(definition, node, prefix));
}
For each subtype, we call JsonProposalProvider.createObjectProposals(ObjectTypeDefinition, AbstractNode, String), which creates the _type_ proposal when there are no other proposals:
The given context is defined by a complex schemaOrReference type. reference is one of its subtypes, and it does not have other keyword-based context assist proposals, so we are adding the _key_ proposal.
Solutions
We can add the default _key_ proposal only when the aggregate result is empty.
Or, we can investigate if we need the _key_ at all and possibly remove it. _key_ was introduced before we had code-assist for the elements described with additionalProperties and was mostly added to cover the additionalProperties cases.
Extracted from https://github.com/RepreZen/KaiZen-OpenAPI-Editor/pull/402#pullrequestreview-67663598
Test added in 0baa0ab
It happens because
com.reprezen.swagedit.core.assist.JsonProposalProvider.createComplextTypeProposals(ComplexTypeDefinition, AbstractNode, String)
:JsonProposalProvider.createObjectProposals(ObjectTypeDefinition, AbstractNode, String)
, which creates the_type_
proposal when there are no other proposals:The given context is defined by a complex
schemaOrReference
type.reference
is one of its subtypes, and it does not have other keyword-based context assist proposals, so we are adding the_key_
proposal.Solutions
_key_
proposal only when the aggregate result is empty._key_
at all and possibly remove it._key_
was introduced before we had code-assist for the elements described withadditionalProperties
and was mostly added to cover theadditionalProperties
cases.