Skip to content

Incorrect *.deps.json selected leads to no functions found #172

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
fredriklrsn opened this issue Jul 9, 2021 · 12 comments · Fixed by #217
Closed

Incorrect *.deps.json selected leads to no functions found #172

fredriklrsn opened this issue Jul 9, 2021 · 12 comments · Fixed by #217

Comments

@fredriklrsn
Copy link

fredriklrsn commented Jul 9, 2021

I have an issue with the open api extension picking the wrong *.deps.json file when determining which dll to search for functions in. This leads to an empty documentation

image

It seems like the first *.deps.json file is selected.

image

and that it searches through the whole app directory and not just the "bin" folder for these files. The app directory may contain multiple *.deps.json, while the "bin" folder only seem to contain one (function.deps.json) which seems to be the one it should be looking for

image

Should it search for *.deps.json directly in the "bin" folder (variable: runtimepath) or search specifically for function.deps.json?

@justinyoo
Copy link
Contributor

@fredriklrsn Thanks for the issue! Let me have a look.

@rockgecko-development
Copy link

This may be causing #122 as well

@kharnt0x
Copy link

This is also causing the same issue when using "func start" from command line to run a function. This causes a /bin/output folder to be generated which contains multiple *.deps.json files, meaning the spec is empty

@kharnt0x
Copy link

I've confirmed that if I delete the other *.deps.json files in the /bin/output directory generated by "func start", the spec starts working

@fredriklrsn
Copy link
Author

Have you had time to investigate the issue yet, @justinyoo ?

@justinyoo
Copy link
Contributor

I basically followed the reproduction step defined at #188. However, I was only able to find one *.deps.json file under the /bin/Debug/netcoreapp3.1.

@fredriklrsn @ducman

Here's my local environment:

  • OS: Mac OS Catalina: v10.15.7
  • .NET Core 3.1 SDK: v3.1.412
  • AzFunc Core Tools: v3.0.3568
  • Azure Functions OpenAPI Extension: v0.8.1-preview

@choipureum
Copy link
Contributor

I also have the same issue that sample code swagger.ui does not work. Swagger.ui works only when the sample code is debug. But it doesn't work when func start in shell. I also think /bin/output/ folder has a problem getting multiple deps.json, including function.deps.json. I am currently testing the case of swagger.json operating during operation. I am testing based on the difference between debug and system startup.

  1. func start in shell
    image

  2. debug mode sample
    image

@vincentbitter
Copy link
Contributor

vincentbitter commented Aug 27, 2021

I'm also having this issue in .NET 5. There is both a .deps.json for the project itself and the referenced library. But only if you start with func start. If I rename my project to AAA.csproj, it works.

My library project file looks like this:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>net5.0</TargetFramework>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.Azure.Cosmos" Version="3.20.1" />
    <PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.4.0" />
    <PackageReference Include="Microsoft.Extensions.Logging" Version="5.0.0" />
  </ItemGroup>
</Project>

@justinyoo
Copy link
Contributor

@fredriklrsn It's resolved, and @vincentbitter 's contribution has been merged to the main repo (not yet published).

Would you please try the new change on your end and let us know?

@fredriklrsn
Copy link
Author

Great. I will test as soon as it is published.

@jwadaptivity
Copy link

hey @justinyoo , any updates on when this will be published?

@fredriklrsn
Copy link
Author

Probably a bit late since it is out of preview now, but I have tried testing this and been getting a different error so I have not been able to verify that it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants