yaml-language-server icon indicating copy to clipboard operation
yaml-language-server copied to clipboard

Schema validator doesn't recognize Null literals

Open imroc opened this issue 1 year ago • 4 comments

Describe the bug

Schema validator output: Incorrect type, Expected string Image

Field schema:

{
  "description": "Time is a wrapper around time.Time which supports correct marshaling to YAML and JSON.  Wrappers are provided for many of the factory methods that the time package offers.",
  "format": "date-time",
  "type": "string"
}

Just like #118 , bug came back again?

yaml-language-server version uses the latest release 1.15.0

imroc avatar Dec 23 '24 03:12 imroc

@imroc May I know which version you are using? In recent version I don't find this issue

Image

msivasubramaniaan avatar Jan 29 '25 13:01 msivasubramaniaan

@msivasubramaniaan The most common scenario: View the complete YAML of the Kubernetes Pod (e.g. kubectl edit pod xxx ), where the lastProbeTime in status.conditions is usually null. Regardless of the yaml-lanaguage-server version used, an error message is displayed: Incorrect type, Expected string , which is ugly.

Image

I always use the latest yamlls (currently I use yamlls 0.17.0):

Image

imroc avatar Mar 28 '25 03:03 imroc

@msivasubramaniaan any plan update?

I've uploaded a video demo (use kubectl edit command, open kubernetes yaml with neovim, and use yaml-language-server as the LSP Server, it's a very common usage scenario):

https://github.com/user-attachments/assets/2b0ccd96-3079-4db4-b862-149b2fd51b96

imroc avatar May 07 '25 09:05 imroc

Moving out of the sprint as the issue needs to be fixed on schema side

msivasubramaniaan avatar Jun 12 '25 10:06 msivasubramaniaan