SteeltoeOSS / InitializrService

Reference implementation of a Steeltoe Initializr Server project generator
Apache License 2.0
5 stars 2 forks source link

No feedback from rest method #78

Closed ddieruf closed 3 years ago

ddieruf commented 3 years ago

I am trying to create a new project using Initilizr with the following powershell

Invoke-RestMethod -Method 'Post' `
  -Uri 'https://start.steeltoe.io/api/project' `
  -OutFile "example_app.zip" `
  -Body @{dotNetFramework="net5.0"
          namespace="example_app"
          name="example_app"
          dependencies="actuator,dynamic-logger,data-mongodb,docker"}

Expand-Archive -Path example_app.zip -DestinationPath . -Force

I expected to get a net5.0 webapi project with all the fixin's and instead I got a netcore3.1 console app with no dependencies. Either my command is incorrect or something behind the scenes is erroring out. Either way it would be nice to get some feedback about what isn't right, instead of defaulting to a basic project.

If I was trying to automate this, I would of had to build a fancy script to verify the csproj actually has the things I asked for because I can't trust Initializr is going to only give me what I asked for.

FYI - the web UI works great. image

ccheetham commented 3 years ago

The issue seems to be either the POST method is not being honored or the JSON is not in expected form.

With regards to the latter possibility, the "standard" behavior if unknown parameters are provided to an endpoint is to is to ignore them. Thus the 200 response is FAD. However if a known parameter is specified with a value outside of its value domain, a 4xx error can be returned. A separate issue, #79, has been opened to handle the case where an unknown dependency has been specified.

ccheetham commented 3 years ago

It seems that the POST parameters are being ignored. #80 opened to address. Closing this issue as FAD.