Skip to content
Merged
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 @@ -56,6 +56,18 @@ const completion: ApidomCompletionItem[] = [
value: 'An array of examples of the server variable.',
},
},
{
label: '$ref',
insertText: '\\$ref',
kind: 14,
format: CompletionFormat.QUOTED,
type: CompletionType.PROPERTY,
insertTextFormat: 2,
documentation: {
kind: 'markdown',
value: 'A reference to a server variable',
},
},
];

export default completion;
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const serverVariableAllowedFieldsLint: LinterMeta = {
message: 'Object includes not allowed fields',
severity: 1,
linterFunction: 'allowedFields',
linterParams: [['enum', 'default', 'description', 'examples'], 'x-'],
linterParams: [['enum', 'default', 'description', 'examples', '$ref'], 'x-'],
marker: 'key',
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,16 @@ const serverAllowedFieldsLint: LinterMeta = {
severity: 1,
linterFunction: 'allowedFields',
linterParams: [
['url', 'protocol', 'protocolVersion', 'description', 'variables', 'security', 'bindings'],
[
'url',
'protocol',
'protocolVersion',
'description',
'variables',
'security',
'bindings',
'$ref',
],
'x-',
],
marker: 'key',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ const serverProtocolRequiredLint: LinterMeta = {
linterFunction: 'hasRequiredField',
linterParams: ['protocol'],
marker: 'key',
conditions: [
{
function: 'missingField',
params: ['$ref'],
},
],
data: {
quickFix: [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ const serverUrlRequiredLint: LinterMeta = {
linterFunction: 'hasRequiredField',
linterParams: ['url'],
marker: 'key',
conditions: [
{
function: 'missingField',
params: ['$ref'],
},
],
data: {
quickFix: [
{
Expand Down