Skip to content
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

OpenAPI build-time generation's file destination is incorrect and causes build errors #34508

Open
sander1095 opened this issue Jan 16, 2025 · 0 comments · May be fixed by #34509
Open

OpenAPI build-time generation's file destination is incorrect and causes build errors #34508

sander1095 opened this issue Jan 16, 2025 · 0 comments · May be fixed by #34509

Comments

@sander1095
Copy link

sander1095 commented Jan 16, 2025

Description

Hi!

I ran into dotnet/aspnetcore#59157 . It correctly states the docs are incorrect:

https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/fundamentals/openapi/aspnetcore-openapi.md#modifying-the-output-directory-of-the-generated-open-api-file

By default, the generated OpenAPI document will be emitted to the application's output directory. To modify the location of the emitted file, set the target path in the OpenApiDocumentsDirectory property.

<PropertyGroup>
  <OpenApiDocumentsDirectory>./</OpenApiDocumentsDirectory>
</PropertyGroup>

The value of OpenApiDocumentsDirectory is resolved relative to the project file. Using the ./ value above will emit the OpenAPI document in the same directory as the project file.

Using this ./ path causes a build error. It should changed to . to build correctly.

Page URL

https://learn.microsoft.com/en-us/aspnet/core/fundamentals/openapi/aspnetcore-openapi?view=aspnetcore-9.0&tabs=visual-studio#modifying-the-output-directory-of-the-generated-open-api-file

Content source URL

https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/fundamentals/openapi/aspnetcore-openapi.md

Document ID

27bad30c-e0b4-10fb-b202-a29d4f8fad24

Article author

@captainsafia

Metadata

  • ID: 27bad30c-e0b4-10fb-b202-a29d4f8fad24
  • Service: aspnet-core
  • Sub-service: fundamentals

Related Issues

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