Skip to content

Option to drop deny_unknown_fields annotations #595

Open
@jez

Description

@jez

This feature request is a follow up to this PR:

#448

Specifically, there was a comment:

I like strict more... jsonrpc provides a way to send arbitrary data in a params field, so I don't see a reason why someone would need to use other fields

While there is the params field for requests, for responses there is just result or error.

The use case that I have for extra top-level fields is that in some languages it's really annoying to have to deserialize untagged unions. The easy fix is to add an extra tag, that can then be ignored by tools that don't need to look for it. If I ever want to look at a JSON RPC response that I know my code serialized, I can look for that extra field, treat it as a tag, and then deserialize according to the value of that tag.

I would like to urge you all to add this back as an option. We would love to make use of it in LanguageClient-neovim. Language Server Protocol clients want to be as permissive as possible to accommodate as many language servers as possible (consider: we can't fix all the language servers, so we try to accomodate them).

A flag to optionally skip the deny_unknown_fields would be appreciated.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions