question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] sharp-giraffe-server creates project with Nuget ref to a deleted package

See original GitHub issue

Bug 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 to AspNet.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:open
  • Created 4 years ago
  • Reactions:2
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
nmfishercommented, Jul 30, 2020

I’ll take a look at it.

On 30 Jul 2020, at 4:58 AM, Daniel Hegner notifications@github.com wrote:

If I knew how to replace the removed package I’d do it. Right now I don’t but it’s a useful tool and an interesting problem so yeah, maybe.

Den ons 29 juli 2020 18:24William Cheng notifications@github.com skrev:

@da9l https://github.com/da9l may I know if you’ve time to contribute a fix? The templates can be found in https://github.com/OpenAPITools/openapi-generator/tree/master/modules/openapi-generator/src/main/resources/fsharp-giraffe-server

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/OpenAPITools/openapi-generator/issues/4568#issuecomment-665765309, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABD23OVIA3FTHRZLAZXY5TR6BENDANCNFSM4JQDTRQQ .

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

0reactions
nmfishercommented, May 31, 2021

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Create and publish a NuGet package using Visual Studio ...
With Microsoft Visual Studio, you can create a NuGet package from a .NET class library, and then publish it to nuget.org using a...
Read more >
Consume NuGet packages | JetBrains Rider Documentation
You can install, update, and remove NuGet packages via the NuGet window Alt+7 and NuGet ... JetBrains Rider: choosing a project to manage...
Read more >
Creating NuGet Packages the easy way with .NET Standard in C
NuGet packages are a way to share versioned code with the world. If you have done any development in C#, you have used...
Read more >
GitHub Actions for .NET Core NuGet packages - Dusted Codes
NET Core NuGet library it is a very useful feature to create a super early version of a NuGet package as soon as...
Read more >
Nuget package changes not reflected in project References list
Right click on “References” and choose to manage Nuget packages. In Nuget Package Manager, install a new Nuget package (like Newtonsoft.Json). Observe that ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found