Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pdk validate does not flag metadata files with invalid JSON escape sequence #925

Closed
timidri opened this issue Nov 20, 2020 · 3 comments
Closed
Labels

Comments

@timidri
Copy link

timidri commented Nov 20, 2020

Describe the bug
When a task metadata json file contains an invalid escape sequence, JSON linters (such as jq and Puppet Forge) raise an error but pdk validate does not flag that issue.

To Reproduce
Consider this task metadata test.json:

{
  "puppet_task_version": 1,
  "supports_noop": false,
  "description": "A description with an invalid \( escape sequence",
  "parameters": {
  }
}

pdk validate task passes normally but jq flags a problem:

cat test.json | jq
parse error: Invalid escape at line 4, column 67

Expected behavior
pdk validate raises the same error as jq.

Additional context

  • Installation method: native packages
  • PDK version 2.1
  • OS: MacOS Catalina / Ubuntu 18.04
@timidri timidri added bug needs-triage Newly created issue that has not been reviewed by a PDK contributor labels Nov 20, 2020
@timidri timidri changed the title PDK validate does not flag invalid task metadata json files pdk validate does not flag metadata files with invalid JSON escape sequence Nov 20, 2020
@sanfrancrisko
Copy link
Contributor

Still an issue in PDK 2.1

@sanfrancrisko sanfrancrisko removed the needs-triage Newly created issue that has not been reviewed by a PDK contributor label Apr 16, 2021
@sanfrancrisko
Copy link
Contributor

Hi @timidri - the underlying gem where this would need to be fixed is metadata-json-lint. Would you be able to raise an issue with them to address?

@timidri
Copy link
Author

timidri commented Sep 21, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants