[BUG] sharp-giraffe-server creates project with Nuget ref to a deleted package
See original GitHub issueBug Report Checklist
- Have you provided a full/minimal spec to reproduce the issue?
- Have you validated the input using an OpenAPI validator (example)? (N/A)
- What’s the version of OpenAPI Generator used?
- Have you search for related issues/PRs?
- What’s the actual output vs expected output?
- [Optional] Bounty to sponsor the fix (example)
Description
The generator for fsharp-giraffe-server
generates a project which has a reference to a Nuget package which has since been deleted, i.e. AspNet.Security.ApiKey.Providers
.
openapi-generator version
4.2.1
OpenAPI declaration file content or url
https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v3.0/petstore.yaml
Command line used for generation
openapi-generator generate -i https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v3.0/petstore.yaml -g fsharp-giraffe-server -o ./petstore
Steps to reproduce
-
Install v4.2.1
-
Run command line above
-
cd petstore/OpenAPI
-
./build.bat
or./build.sh
-
Note error:
OpenAPI.fsproj : error NU1101: Unable to find package AspNet.Security.ApiKey.Providers. No packages exist with this id in source(s): Microsoft Visual Studio Offline Packages, nuget, (our private feeds)
-
Edit
src/OpenAPI.fsproj
, note reference toAspNet.Security.ApiKey.Providers
-
Navigate to https://www.nuget.org/packages/AspNet.Security.ApiKey.Providers/
-
Note 'This package has been deleted from the gallery`.
Related issues/PRs
None found.
Suggest a fix
Not sure what role the missing package was intended to take, but I guess we need to either:
- Remove the reference in the generated code and remove any - presumably optional - generated code which would have used the package OR
- Identify a replacement package to perform the same role and amend generated code accordingly.
(The output of the generator looks very good apart from this, so I’m hoping this issue will be easy to fix 😉 .)
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:6 (3 by maintainers)
I’ll take a look at it.
Sorry it’s taken me so long to get around to this.
This branch should fix the error but I can’t guarantee that API key auth will work out the box:
https://github.com/nmfisher/openapi-generator/tree/fsharp-giraffe-fixes
If anyone can test for me, please do so.