question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[RFC] Teach overrides to honor JSON Pointers

See original GitHub issue

Potential laxer locations syntaxes have been evoked in #939 and eventually dropped out to keep the PR on scope.

This issue is a placeholder to gather feedback, use cases and try and measure how important allowing less strict locations would be.

From https://github.com/stoplightio/spectral/pull/939#discussion_r387493237

Current location syntax is: <source>#<pointer> where

  • source can be expressed as
    • an absolute uri (file or http based)
    • relatively to the to the rulesepath uri
  • pointer is a Json pointer (cf. https://tools.ietf.org/html/rfc6901) describing the precise document path that should be ignored

Latest update to the proposal was to allow a more open location syntax where

  • <source> could be optional #1423
  • #<pointer> could be optional #1405
  • at least one of them should be described #1423
  • <pointer> meaning would change

Samples:

  • models/awful.json: [ rule1, rule2]: Would ignore rule1 and rule2 results wheverever in the file
  • #/info": [rule1, rule2]: Would ignore rule1 and rule2 results in any processed document provided they originate from a path that’s #/info or below (eg. #/info/sub/path/1). This would be in line with @P0lip’s comment

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
mnaumanali94commented, Jun 7, 2021

@ariatron This has been added to the scope for v6! 🙏

0reactions
stoplight-botcommented, Jul 7, 2021

🎉 This issue has been resolved in version @stoplight/spectral-core-v1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Read more comments on GitHub >

github_iconTop Results From Across the Web

JavaScript Object Notation (JSON) Pointer RFC 6901
JavaScript Object Notation (JSON) Pointer
Read more >
JSON Pointers
RFC6901 JSON Pointers and RFC Draft Relative JSON Pointers are the basis for BIG-IP Declarative Onboarding pointers, but support special relative references ...
Read more >
encoding/json
Package json implements encoding and decoding of JSON as defined in RFC 7159. The mapping between JSON and Go values is described in...
Read more >
MessagePack: It's like JSON. but fast and small.
MessagePack is an efficient binary serialization format. It lets you exchange data among multiple languages like JSON. But it's faster and smaller. Small ......
Read more >
Go
4 5 // Package json implements encoding and decoding of JSON as defined in 6 // RFC 7159. The mapping between JSON and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found