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.

feature request: Hide AJVs "unknown format" complaints

See original GitHub issue

Describe the bug

According to the spec, format is is an open string-valued property, and can have any value. Spectral generates (pollutes?) stdout with warnings about "unknown format"s.

To Reproduce

repro/output.openapi.yaml

openapi: 3.0.0
servers:
  - url: "https://ex-ample.com"
x-format-version: "1.0"
info:
  title: Four
  description: Issue repro 4
  contact:
    email: e@e.com
  version: 0.0.0
paths: {}
components:
  schemas:
    AModel:
      description: Yet another self descriptive explanation
      type: object
      properties:
        a_country:
          description: Guess what? A country.
          type: string
          format: "ISO-3166-1 alpha-2"
          example: de

Run

$ yarn spectral lint repro/output.openapi.yaml -o repro/log.txt -q
yarn run v1.15.2
$ C:\REDACTED\node_modules\.bin\spectral lint repro/output2.openapi.yaml -o repro/log.txt -q
unknown format "ISO-3166-1 alpha-2" ignored in schema at path "#"
unknown format "ISO-3166-1 alpha-2" ignored in schema at path "#"
Done in 1.52s.

repro/log.txt

(empty)

Expected behavior Nothing in stderr/stdout

Environment (remove any that are not applicable):

  • Library version: 4.0.1
  • OS: Windows 7

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
philsturgeoncommented, Jul 20, 2019

Hey there, this related to https://github.com/epoberezkin/ajv/issues/466 in which the author of AJV makes it very clear that people should be aware of unknown formats.

I would like to try and hide these specific messages because you are correct, the OAS spec does say you can use whatever you want.

0reactions
chris-miaskowskicommented, Aug 29, 2019

and maybe a follow up feature could be to have those format messages converted to spectral warnings or info 😃

Sounds good. Had a quick look and surfacing it at the spectral messages level will require some more work.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Feature Request: Automatic Unrequiring Hidden Fields - Jotform
Hello SunbridgeInstitute,. Can you please let me know which hidden question of your form is still required even if the field itself. Please...
Read more >
Untitled
Nbr 2014, Huw davies bbc, Thl w8s camera review, 30k op squad builder fifa 15, ... Samri saudi, Make search form access 2010,...
Read more >
Expression of Antimicrobial Peptide Genes in the Canine ...
Several studies have demonstrated its properties, including antimicrobial features. As a result of the restricted availability of human ...
Read more >
Transcriptomics and Metabolomics Changes Triggered by ...
Inflorescence removal increases the yield and quality of P. notoginseng, but the underlying molecular mechanisms are unknown.
Read more >
Copyright © 2019 The American Society of Human Genetics ...
recessive mutations, but the contribution of dominant de novo mutations (DNMs) to this trait is unknown. Here, we performed genetic studies ...
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