You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
JSON pointers must use %7B and %7D to represent brackets for correct functionality in the Spectral CLI and SDK. However, the VSCode extension does not handle this encoding properly. Instead, it only recognizes literal bracket characters, which is incorrect.
To Reproduce
Given this example OpenAPI document:
openapi: 3.0.3
info:
title: Swagger Petstore - OpenAPI 3.0
description: test
contact:
email: [email protected]
version: 1.0.11
servers:
- url: https://petstore3.swagger.io/api/v3
paths:
/pet/{petId}/test:
get:
summary: Find pet by ID
description: Returns a single pet
operationId: getPetById
parameters:
- name: petId
in: path
description: ID of pet to return
required: true
schema:
type: integer
responses:
'200':
description: test
Run the document through both the CLI and the VSCode extension. You will see an operation-tags warning.
Use this .spectral file:
extends: spectral:oas
overrides:
- files:
- "**#/paths/~1pet~1%7BpetId%7D~1test"
rules:
operation-tags: off
Notice the warning will not appear within the CLI, but will be present within the VSCode extension.
Use this .spectral file:
extends: spectral:oas
overrides:
- files:
- "**#/paths/~1pet~1{petId}~1test"
rules:
operation-tags: off
Notice the warning will not appear in the VSCode extension but will be present within the CLI.
Expected behavior
The VSCode extension should correctly parse %7B and %7D representations of brackets, ensuring no warnings appear when using the first .spectral file. Screenshots
No Errors with literal bracket characters:
Errors with %7B and %7D encoding of bracket characters:
Environment:
Spectral CLI version: 6.11.1
Extension version: 1.1.2
VS Code version: 1.92.2
Operating System: Windows 11
The text was updated successfully, but these errors were encountered:
EthanHonzikSPS
changed the title
Angle brackets not parsed correctly in JSON pointers
Brackets not parsed correctly in JSON pointers
Aug 23, 2024
Describe the bug
JSON pointers must use %7B and %7D to represent brackets for correct functionality in the Spectral CLI and SDK. However, the VSCode extension does not handle this encoding properly. Instead, it only recognizes literal bracket characters, which is incorrect.
To Reproduce
Run the document through both the CLI and the VSCode extension. You will see an operation-tags warning.
Use this .spectral file:
Expected behavior
The VSCode extension should correctly parse %7B and %7D representations of brackets, ensuring no warnings appear when using the first .spectral file.
Screenshots
No Errors with literal bracket characters:
Errors with %7B and %7D encoding of bracket characters:
Environment:
The text was updated successfully, but these errors were encountered: