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

Invalid Swagger specification file. Info section doesn't exists. #1855

Closed
rhys-intelliflo opened this issue Feb 1, 2018 · 4 comments
Closed

Comments

@rhys-intelliflo
Copy link

Issue type

[ ] Feature request
[X] Bug report
[ ] Documentation

I have installed PSSwagger and and ran the following function only for it to state
"Invalid Swagger specification file. Info section doesn't exists."

New-PSSwaggerModule -SpecificationUri https://FQDN/api/docs/%3Fformat=openapi -Name PSNetbox -Path . -Verbose

Looking through the PowerShell source code it's this line that throws the error saying that it cannot find the "info" section.

Steps to reproduce

Install-Module -Name PSSwagger -Scope CurrentUser
Import-Module PSSwagger
New-PSSwaggerModule -SpecificationUri https://FQDN/api/docs/%3Fformat=openapi -Name PSNetbox -Path . -Verbose

Environment

  • Python version: 3
  • NetBox version: 2.2.8

Any ideas / thoughts?

@aaroneg
Copy link
Contributor

aaroneg commented Feb 5, 2018

Also seeing weirdness with PSSwagger. v2.2.9.

@davcamer
Copy link
Contributor

davcamer commented Feb 28, 2018

I am working on generating a golang client from swagger. As part of that, I have a more complete swagger.json for Netbox v2.3 committed over here:
https://github.com/davcamer/go-netbox/blob/swagger-generated/swagger.json

I tried generating a client using powershell on MacOS and it got fairly far in to generating the operations, although did eventually die with an error about AutoRest being missing. You might have more luck with the swagger file on windows?

Here is the tail of my generation session, using that file:

VERBOSE: Using cmdlet name 'Virtualmachinescreate-Virtualization' for Swagger path operationid 'virtualization_virtual-machines_create'.
VERBOSE: Getting details for Swagger path operation with operationid 'virtualization_virtual-machines_read'.
VERBOSE: Verb 'virtual-machines_read' not an approved verb.
VERBOSE: Using cmdlet name 'Virtualmachinesread-Virtualization' for Swagger path operationid 'virtualization_virtual-machines_read'.
VERBOSE: Getting details for Swagger path operation with operationid 'virtualization_virtual-machines_update'.
VERBOSE: Verb 'virtual-machines_update' not an approved verb.
VERBOSE: Using cmdlet name 'Virtualmachinesupdate-Virtualization' for Swagger path operationid 'virtualization_virtual-machines_update'.
VERBOSE: Getting details for Swagger path operation with operationid 'virtualization_virtual-machines_partial_update'.
VERBOSE: Verb 'virtual-machines_partial_update' not an approved verb.
VERBOSE: Using cmdlet name 'Virtualmachinespartialupdate-Virtualization' for Swagger path operationid 'virtualization_virtual-machines_partial_update'.
VERBOSE: Getting details for Swagger path operation with operationid 'virtualization_virtual-machines_delete'.
VERBOSE: Verb 'virtual-machines_delete' not an approved verb.
VERBOSE: Using cmdlet name 'Virtualmachinesdelete-Virtualization' for Swagger path operationid 'virtualization_virtual-machines_delete'.
VERBOSE: Generating CSharp Code using AutoRest
Unable to find AutoRest in PATH environment. Ensure the PATH is updated.
At /Users/davecameron/.local/share/powershell/Modules/PSSwagger/0.3.0/PSSwagger.psm1:744 char:9
+         throw $LocalizedData.AutoRestNotInPath
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : OperationStopped: (Unable to find ...ATH is updated.:String) [], RuntimeException
+ FullyQualifiedErrorId : Unable to find AutoRest in PATH environment. Ensure the PATH is updated.

@jeremystretch jeremystretch added status: under review Further discussion is needed to determine this issue's scope and/or implementation and removed help wanted labels Mar 22, 2018
@jeremystretch
Copy link
Member

#1930 has been merged into develop. Can we confirm whether this issue has been resolved?

@bbock
Copy link
Contributor

bbock commented Apr 18, 2018

I can confirm that with netbox 2.3.2, the swagger file contains a valid info section.

IMO this bug is resolved.

@jeremystretch jeremystretch removed the status: under review Further discussion is needed to determine this issue's scope and/or implementation label Apr 18, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Jan 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants