Comments (9)
Here's the code that creates the Schema with "properties"
but no "type"
.
data-api-builder/src/Core/Services/OpenAPI/OpenApiDocumentor.cs
Lines 938 to 941 in 466c18a
from data-api-builder.
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 describedproperties
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.
It has been determined that Infragistics AppBuilder is looking for a missing property in the schema, see below
It is unclear if this is required by the OpenAPI specs or if it is a miss interpretation by Infragistics.
from data-api-builder.
I think this needs to be considered as a bug.
The lack of the "type" permits any other type as valid:
The mere presence of "properties" is not enough to specify type object.
from data-api-builder.
Thanks make sense. How do we go forward from here ?
from data-api-builder.
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:
- OAI/OpenAPI-Specification#1657
- OpenAPI-Specification discussion
- PaloAltoNetworks/docusaurus-openapi-docs#430
- Example of how different tooling handles
type
or missingtype
differently.
- Example of how different tooling handles
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 propertyproperties
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.
Thx for you work
from data-api-builder.
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 describedproperties
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.
Related #2262
from data-api-builder.
Related Issues (20)
- [Enhancement]: Log file sink
- [Enhancement]: "Complete" to cache HOT 1
- [Bug]: Data Api Builder should be consuming JwtBearerOptions HOT 3
- [Test Bug] Fix GraphQLSupportTypesTestsBase.cs datarows for QueryTypeColumn test. HOT 1
- [Enhancement] : Allow role level query depth limits HOT 1
- UPGRADE ChilliCream HotChocolate to V13
- Add GraphQL depth limit to request time instead at Startup
- [Bug]: Error message 'Could not initialize the engine with the runtime config file: dab-config.json' isn't clear enough HOT 4
- [Enhancement]: Custom Metadata for Entities and Fields.
- Bump Azure.Identity version
- [Bug]: GraphQL query execution fails after dab update HOT 4
- [Bug]: GraphQL Filter input for MSSQL -> DateTimeOffset without offset is assumed current timezone instead of UTC.
- Postgresql database connection with Workload Identity in an AKS deployment HOT 1
- [Bug]: GraphQL pagination with order by statements omits values HOT 2
- [Enhancement]: Complete our OpenAPI implementation HOT 1
- Update `dab.draft.schema.json` with null support for more properties to pass `dab validate`
- Data api builder JWT authentication not working locally.
- [Bug]: caseInsensitive not working on GraphQL query
- [Bug]: GraphQL pagination attempts to return hasNextPage = null and fails with "Cannot return null for non-nullable field" HOT 3
- [Bug]: Float fields get saved based on local Windows Regional format setting
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from data-api-builder.