Skip to content

Add Web Application project support for build-time OpenAPI document generation #8242

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
4 tasks done
mkArtakMSFT opened this issue Mar 6, 2019 · 4 comments
Closed
4 tasks done
Assignees
Labels
area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates Done This issue has been fixed enhancement This issue represents an ask for new feature or an enhancement to an existing one Needs: Spec Indicates that a spec defining user experience is required

Comments

@mkArtakMSFT
Copy link
Contributor

mkArtakMSFT commented Mar 6, 2019

@glennc, the experience for this should be defined.
Here are the list of items we need clarity on:

  • Define the changes in csproj file indicating that the document should be auto-generated
    • no .csproj changes should be needed by default e.g. projects that include the new project must opt out of document generation during builds
  • Define the details regarding where the generated document should be placed (defaults)
    • will use the obj/ directory by default
  • Define user's options for overriding our defaults
    • minimal
  • Define options for generating additional document(s)
    • no new options for this, build getting the document names list into dotnet-getdocument tool
@mkArtakMSFT mkArtakMSFT added 1 - Ready enhancement This issue represents an ask for new feature or an enhancement to an existing one labels Mar 6, 2019
@mkArtakMSFT mkArtakMSFT added this to the 3.0.0-preview5 milestone Mar 6, 2019
@Eilon Eilon added the area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates label Mar 6, 2019
@mkArtakMSFT mkArtakMSFT added cost: M Needs: Spec Indicates that a spec defining user experience is required labels Mar 13, 2019
@mkArtakMSFT mkArtakMSFT assigned glennc and unassigned dougbu Mar 13, 2019
@dougbu
Copy link
Contributor

dougbu commented Apr 18, 2019

We have enough of a spec that I'll get a design PR out in this milestone. Reassigning to myself and placing the completed installation in Preview6.

@dougbu dougbu assigned dougbu and unassigned glennc Apr 18, 2019
@dougbu dougbu modified the milestones: 3.0.0-preview5, 3.0.0-preview6 Apr 18, 2019
dougbu added a commit that referenced this issue Apr 22, 2019
- set `%(FirstForGenerator)` based on `%(CodeGenerator)` metadata

Side note, PR fixes include
- add `%(FirstForGenerator)` metadata, #4916
- add support for disabling design-time builds, #4944
- change default output directory to `obj/`, #4945 1 of 2 (remainder will come with #8242)
- provide a default `%(CodeGenerator)` value, ##7491 1 of 2 (remainder will come in next milestone)
@dougbu
Copy link
Contributor

dougbu commented Apr 22, 2019

Work to do:

  • create new Microsoft.Extensions.ApiDescription.Server project / package containing the bits of the old Microsoft.Extensions.ApiDescription.Design project / package specific to getting documents
  • change MSBuild infrastructure to work on the current project
  • enhance dotnet-getdocument tool to use new GetDocumentNames(...) method in IDocumentProvider interface
    • main point is to avoid user ever having to duplicate document names in .csproj and Startup class
    • cache document names somewhere for use in MSBuild infrastructure
  • as a follow up to Change default document directory to obj #4945, place documents in $(BaseIntermediateOutputPath)
  • implement OpenApiGetDocuments target
  • add a project capability

related issues:

dougbu added a commit that referenced this issue May 30, 2019
…all documents in one go

- #8242 1 of 2
- save a cache file listing all retrieved documents
- remove .NET Core App 2.0 support
- remove ServiceProjectReferenceMetadata.targets, related `Project` class, and searches for a project
  - tools will run within a project and get needed information from project on command line
- roll framework forward in both tools to expand their applicability

nits:
- refactor methods in `GetDocumentCommandWorker`
- reorder option addition for consistency and to place `--help` at the top of help output
- consolidate information about method signatures at top of `GetDocumentCommandWorker`
- consolidate `try` / `catch` blocks in `GetDocumentCommandWorker`
dougbu added a commit that referenced this issue Jun 3, 2019
…all documents in one go

- #8242 1 of 2
- save a cache file listing all retrieved documents
- remove .NET Core App 2.0 support
- remove ServiceProjectReferenceMetadata.targets, related `Project` class, and searches for a project
  - tools will run within a project and get needed information from project on command line
- roll framework forward in both tools to expand their applicability

nits:
- refactor methods in `GetDocumentCommandWorker`
- reorder option addition for consistency and to place `--help` at the top of help output
- consolidate information about method signatures at top of `GetDocumentCommandWorker`
- consolidate `try` / `catch` blocks in `GetDocumentCommandWorker`
dougbu added a commit that referenced this issue Jun 3, 2019
…cuments in one go (#10667)

- #8242 1 of 2
- save a cache file listing all retrieved documents
- remove .NET Core App 2.0 support
- remove ServiceProjectReferenceMetadata.targets, related `Project` class, and searches for a project
  - tools will run within a project and get needed information from project on command line
- roll framework forward in both tools to expand their applicability when using .NET Core
- use Microsoft.Extensions.HostFactoryResolver.Sources (part of #4923)
  - remove Microsoft.AspNetCore.Hosting.Abstractions dependency

nits:
- refactor methods in `GetDocumentCommandWorker`
- reorder option addition for consistency and to place `--help` at the top of help output
- consolidate information about method signatures at top of `GetDocumentCommandWorker`
- consolidate `try` / `catch` blocks in `GetDocumentCommandWorker`
- shorten the lifespan of a `Task`
- ensure GetDocument.Insider exit codes are unique
- make a few more `string`s `const`
- fold a few expressions over fewer lines
@dougbu
Copy link
Contributor

dougbu commented Jun 3, 2019

part 1: 4c8ca0b

dougbu added a commit that referenced this issue Jun 4, 2019
…0669)

- #8242 2 of 2, # #4912
- add missing project reference provider
  - remove incorrect `$(IsImplementationProject)` settings in `dotnet-getdocument` and `GetDocumentInsider`
  - re-run .\eng\scripts\GenerateProjectList.ps1
@dougbu
Copy link
Contributor

dougbu commented Jun 4, 2019

part 2 (of 2): b3ddd65

@dougbu dougbu closed this as completed Jun 4, 2019
@dougbu dougbu added Done This issue has been fixed and removed Working labels Jun 4, 2019
@ghost ghost locked as resolved and limited conversation to collaborators Dec 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates Done This issue has been fixed enhancement This issue represents an ask for new feature or an enhancement to an existing one Needs: Spec Indicates that a spec defining user experience is required
Projects
None yet
Development

No branches or pull requests

4 participants