Giter VIP home page Giter VIP logo

Comments (9)

pmoleri avatar pmoleri commented on September 17, 2024 1

Here's the code that creates the Schema with "properties" but no "type".

Schema = new()
{
Properties = responseBodyProperties
}

from data-api-builder.

seantleonard avatar seantleonard commented on September 17, 2024 1

Hi @seantleonard ,

Thank you for picking up this. While it's true that type is not required, I think it's incorrect in the context of DAB response.

  • type + properties means "it must be an object and the properties are as described
  • properties only means "it can be any type, when it's an object the properties are as described
    (see my validation example with a plain integer in the previous post).

DAB response is always an object and it's best described as such as it will improve compatibility. I'm glad you agreed, I just wanted to provide additional input for the decision. Thanks again

Sorry to imply that I was trying to justify whether to do this or not. I fully intend to do so.

I intended to figure out whether type was required because I wanted to identify why https://github.com/microsoft/OpenAPI.NET didn't complain about missing type. An error if type were required would have helped prevent this becoming an issue in the first place. Thanks for bringing this to my attention.

from data-api-builder.

chrohrbach avatar chrohrbach commented on September 17, 2024

It has been determined that Infragistics AppBuilder is looking for a missing property in the schema, see below
image
It is unclear if this is required by the OpenAPI specs or if it is a miss interpretation by Infragistics.

from data-api-builder.

pmoleri avatar pmoleri commented on September 17, 2024

I think this needs to be considered as a bug.
The lack of the "type" permits any other type as valid:
image

The mere presence of "properties" is not enough to specify type object.

from data-api-builder.

chrohrbach avatar chrohrbach commented on September 17, 2024

Thanks make sense. How do we go forward from here ?

from data-api-builder.

seantleonard avatar seantleonard commented on September 17, 2024

Thank you for reporting, @chrohrbach. I'm working on a fix.

I found a relevant thread that discusses whether type is a required property. Consensus is that type isn't required:

Ultimately, different tooling handles the presence of the type property differently. Some may try to guess the type when not present:

  • e.g. object when the property properties exists.

That said, there is no reason why DAB shouldn't add this so that Infragistics tooling can work. I'm curious whether this is the only error that Infragistics emits when evaluating the OpenAPI document generated by DAB.

from data-api-builder.

chrohrbach avatar chrohrbach commented on September 17, 2024

Thx for you work

from data-api-builder.

pmoleri avatar pmoleri commented on September 17, 2024

Hi @seantleonard ,

Thank you for picking up this. While it's true that type is not required, I think it's incorrect in the context of DAB response.

  • type + properties means "it must be an object and the properties are as described
  • properties only means "it can be any type, when it's an object the properties are as described
    (see my validation example with a plain integer in the previous post).

DAB response is always an object and it's best described as such as it will improve compatibility.
I'm glad you agreed, I just wanted to provide additional input for the decision.
Thanks again

from data-api-builder.

JerryNixon avatar JerryNixon commented on September 17, 2024

Related #2262

from data-api-builder.

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.