Skip to content

Support for OpenAPI description in a Infragistics AppBuilder integration use case #2212

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 task done
chrohrbach opened this issue May 13, 2024 · 9 comments · Fixed by #2283
Closed
1 task done
Labels
bug Something isn't working cri Customer Reported issue enhancement New feature or request open-api rest
Milestone

Comments

@chrohrbach
Copy link

What happened?

It seems that DAB does not generate enough information when an endpoint is called by Infragistics AppBuilder that requires some details to be able to use the endpoint correctly, see the description here. I searched for possibilities to configure the expressivness of DABs openapi interface but did not find any information about such a possibility. In a Infragistics forum post, see here, the problem is described and solved with access to the underlying endpoint source code, i don't feel confident to go to the source code of DAB to check this. Thanks for your time in helping me out with this topic.

Version

latest

What database are you using?

Azure SQL

What hosting model are you using?

Local (including CLI)

Which API approach are you accessing DAB through?

REST

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@chrohrbach chrohrbach added bug Something isn't working triage issues to be triaged labels May 13, 2024
@chrohrbach
Copy link
Author

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.

@chrohrbach chrohrbach changed the title Support for OpenAPI description in a Infragistics AppBuilder intregration use case Support for OpenAPI description in a Infragistics AppBuilder integration use case May 23, 2024
@pmoleri
Copy link

pmoleri commented May 23, 2024

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

Schema = new()
{
Properties = responseBodyProperties
}

@pmoleri
Copy link

pmoleri commented May 23, 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.

@chrohrbach
Copy link
Author

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

@seantleonard
Copy link
Contributor

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.

@seantleonard seantleonard added enhancement New feature or request rest open-api and removed triage issues to be triaged labels May 24, 2024
@seantleonard seantleonard added this to the 1.3 milestone May 24, 2024
@seantleonard seantleonard added the cri Customer Reported issue label May 25, 2024
@chrohrbach
Copy link
Author

Thx for you work

@pmoleri
Copy link

pmoleri commented May 27, 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

@seantleonard
Copy link
Contributor

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.

@JerryNixon
Copy link
Contributor

Related #2262

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cri Customer Reported issue enhancement New feature or request open-api rest
Projects
None yet
4 participants