Skip to content

[Bug] JSON schema field missing in suggestion dropdown #3339

@mesudip

Description

@mesudip

Reproducible in vscode.dev or in VS Code Desktop?

  • Not reproducible in vscode.dev or VS Code Desktop

Reproducible in the monaco editor playground?

Monaco Editor Playground Code

// Configures two JSON schemas, with references.

var jsonCode = ['{', '}'].join('\n');
var modelUri = monaco.Uri.parse('a://b/foo.json'); // a made up unique URI for our model
var model = monaco.editor.createModel(jsonCode, 'json', modelUri);

// configure the JSON language support with schemas and schema associations
monaco.languages.json.jsonDefaults.setDiagnosticsOptions({
	validate: true,
	schemas: [
		{
			uri: 'http://myserver/foo-schema.json', // id of the first schema
			fileMatch: [modelUri.toString()], // associate with our model
			schema: {
				type: 'object',
				properties: {
                                        constructor: {type: "integer",required:true},
                                        fields: {
                                            type: "array",
                                            items: {
                                                type: "string",
                                            }, 
                                            required: true
                                        }
                                },
                                "additionalProperties": false,

			}
		},
	]
});

monaco.editor.create(document.getElementById('container'), {
	model: model
});

Reproduction Steps

if you type " between the curly braces, the suggestion dropdown pops up but it only contains fields property. the constructor property is missing.

Actual (Problematic) Behavior

constructor is missing in the field suggestion

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bugjson

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions