Skip to content

Conversation

@xDDDx
Copy link
Contributor

@xDDDx xDDDx commented Apr 26, 2022

This solves the issue #424

The assemblies are loaded twice and so the types

@ghost
Copy link

ghost commented Apr 26, 2022

CLA assistant check
All CLA requirements met.

Copy link
Contributor

@justinyoo justinyoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xDDDx Thanks for the PR! As long as I understand correctly, it needs to be merged after #424, right?

Would you be able to add some test cases to support your changes?

@xDDDx
Copy link
Contributor Author

xDDDx commented Apr 28, 2022

@justinyoo I added some DistinctBy tests. The problem with DistinctBy is, that it is part of .net6 in System.Linq but not in net5 and below. I`m not sure what is the right approach to use it with multiple frameworks

I'm not sure about #424 This can be a wrong fix. What if I'm realy defined two different endpoints and gived them same operation id? Or is it also a problem for functions like this with getand poste.g.?

[OpenApiOperation(operationId: "health-check")]
public async Task<HttpResponseData> Run([HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = "check")] HttpRequestData req)

@justinyoo
Copy link
Contributor

@justinyoo I added some DistinctBy tests. The problem with DistinctBy is, that it is part of .net6 in System.Linq but not in net5 and below. I`m not sure what is the right approach to use it with multiple frameworks

I'm not sure about #424 This can be a wrong fix. What if I'm realy defined two different endpoints and gived them same operation id? Or is it also a problem for functions like this with getand poste.g.?

[OpenApiOperation(operationId: "health-check")]
public async Task<HttpResponseData> Run([HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = "check")] HttpRequestData req)
  1. As we support .NET Core 3.1, .NET 5 and .NET 6, our change must be applicable to all those three versions. I saw you've changed it from DistinctBy to DistinctByProperty, which should be fine.
  2. At the beginning, the message body tagged Only add unique openApiReferenceIds to the exported types #424 That's why I asked whether it's relevant or not.
  3. According to the OpenAPI spec, there must be only one unique operation ID in one OpenAPI document.
  4. Although AzFunc support multiple verbs, OpenAPI extension assumes each method only takes one verb. If there are more than one verbs declared in one method, only the first one is taken.

Copy link
Contributor

@justinyoo justinyoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@justinyoo justinyoo merged commit f7070c6 into Azure:main Apr 29, 2022
@justinyoo justinyoo linked an issue Apr 29, 2022 that may be closed by this pull request
jackbatzner pushed a commit to jackbatzner/azure-functions-openapi-extension that referenced this pull request May 6, 2022
* Distinct same types

* This fixes issue Azure#424

* added DistincByProperty tests

Co-authored-by: Demetrius Axenowski <[email protected]>
@justinyoo justinyoo added the bug Something isn't working label Aug 22, 2022
@justinyoo justinyoo added this to the Release 202208 - v1.4.0 milestone Aug 22, 2022
Derich367 pushed a commit to Derich367/azure-functions-openapi-extension that referenced this pull request Aug 31, 2022
* Distinct same types

* This fixes issue Azure#424

* added DistincByProperty tests

Co-authored-by: Demetrius Axenowski <[email protected]>
Derich367 pushed a commit to Derich367/azure-functions-openapi-extension that referenced this pull request Jan 30, 2023
* Distinct same types

* This fixes issue Azure#424

* added DistincByProperty tests

Co-authored-by: Demetrius Axenowski <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

An item with the same key has already been added.

3 participants