Giter VIP home page Giter VIP logo

Comments (1)

flobernd avatar flobernd commented on July 1, 2024

Hi @gpetrou,

thanks again for testing the new version and reporting rough edges. That's super helpful 🙂

Semantics for Fields and Field[] are actually different. The specification defines Fields as:

export type Fields = Field | Field[]

We call this a "single-or-many" construct. The ES server accepts the JSON property in a singular form "field" and in an array form ["field", "..."].

Field[] on the other hand, only accepts the array form.

The old generator incorrectly replaced Field[] with Fields which caused an issue with e.g. the stored_fields that Steve tried to fix in #8018.

The current way of generating these properties is semantically correct, but a litte bit cumbersome to use. A proper fix that I've planned involves removing the [JsonConverter(typeof(FieldsConverter))] attribute from the Fields class. Afterwards, the generator will emit Field[] properties using the Fields type again, but dynamically places converter attributes on the properties - depending on the semantics (either FieldsConverter or FieldArrayConverter).

I expect to release this improvement already in the beginning of the next week.

from elasticsearch-net.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.