swagger-parser
swagger-parser copied to clipboard
Swagger parser resulted null for some swagger files
The following swagger file returns null when it passes through the swagger parser
swagger: "2.0"
consumes:
- application/json
definitions:
IpTag:
description: Contains the IpTag associated with the object
properties:
ipTagType:
description: 'Gets or sets the ipTag type: Example FirstPartyUsage.'
type: string
tag:
description: Gets or sets value of the IpTag associated with the public IP.
Example SQL, Storage etc
type: string
PublicIPAddress:
allOf:
- description: Common resource representation.
properties:
id:
description: Resource ID.
type: string
location:
description: Resource location.
type: string
name:
description: Resource name.
readOnly: true
type: string
tags:
additionalProperties:
type: string
description: Resource tags.
type: object
type:
description: Resource type.
readOnly: true
type: string
x-ms-azure-resource: true
description: Public IP address resource.
properties:
etag:
description: A unique read-only string that changes whenever the resource
is updated.
type: string
properties:
$ref: '#/definitions/PublicIPAddressPropertiesFormat'
description: Public IP address properties.
x-ms-client-flatten: true
sku:
description: SKU of a public IP address
properties:
name:
description: Name of a public IP address SKU.
enum:
- Basic
- Standard
type: string
x-ms-enum:
modelAsString: true
name: PublicIPAddressSkuName
zones:
description: A list of availability zones denoting the IP allocated for the
resource needs to come from.
items:
type: string
type: array
PublicIPAddressDnsSettings:
description: Contains FQDN of the DNS record associated with the public IP address
properties:
domainNameLabel:
description: Gets or sets the Domain name label.The concatenation of the domain
name label and the regionalized DNS zone make up the fully qualified domain
name associated with the public IP address. If a domain name label is specified,
an A DNS record is created for the public IP in the Microsoft Azure DNS
system.
type: string
fqdn:
description: Gets the FQDN, Fully qualified domain name of the A DNS record
associated with the public IP. This is the concatenation of the domainNameLabel
and the regionalized DNS zone.
type: string
reverseFqdn:
description: 'Gets or Sets the Reverse FQDN. A user-visible, fully qualified
domain name that resolves to this public IP address. If the reverseFqdn
is specified, then a PTR DNS record is created pointing from the IP address
in the in-addr.arpa domain to the reverse FQDN. '
type: string
PublicIPAddressListResult:
description: Response for ListPublicIpAddresses API service call.
properties:
nextLink:
description: The URL to get the next set of results.
type: string
value:
description: A list of public IP addresses that exists in a resource group.
items:
$ref: '#/definitions/PublicIPAddress'
type: array
PublicIPAddressPropertiesFormat:
description: Public IP address properties.
properties:
dnsSettings:
description: Contains FQDN of the DNS record associated with the public IP
address
properties:
domainNameLabel:
description: Gets or sets the Domain name label.The concatenation of the
domain name label and the regionalized DNS zone make up the fully qualified
domain name associated with the public IP address. If a domain name
label is specified, an A DNS record is created for the public IP in
the Microsoft Azure DNS system.
type: string
fqdn:
description: Gets the FQDN, Fully qualified domain name of the A DNS record
associated with the public IP. This is the concatenation of the domainNameLabel
and the regionalized DNS zone.
type: string
reverseFqdn:
description: 'Gets or Sets the Reverse FQDN. A user-visible, fully qualified
domain name that resolves to this public IP address. If the reverseFqdn
is specified, then a PTR DNS record is created pointing from the IP
address in the in-addr.arpa domain to the reverse FQDN. '
type: string
idleTimeoutInMinutes:
description: The idle timeout of the public IP address.
format: int32
type: integer
ipAddress:
description: The IP address associated with the public IP address resource.
type: string
ipConfiguration:
$ref: ./networkInterface.json#/definitions/IPConfiguration
description: The IP configuration associated with the public IP address.
readOnly: true
ipTags:
description: The list of tags associated with the public IP address.
items:
description: Contains the IpTag associated with the object
properties:
ipTagType:
description: 'Gets or sets the ipTag type: Example FirstPartyUsage.'
type: string
tag:
description: Gets or sets value of the IpTag associated with the public
IP. Example SQL, Storage etc
type: string
type: array
provisioningState:
description: 'The provisioning state of the PublicIP resource. Possible values
are: ''Updating'', ''Deleting'', and ''Failed''.'
type: string
publicIPAddressVersion:
description: 'The public IP address version. Possible values are: ''IPv4''
and ''IPv6''.'
enum:
- IPv4
- IPv6
type: string
x-ms-enum:
modelAsString: true
name: IPVersion
publicIPAllocationMethod:
description: 'The public IP allocation method. Possible values are: ''Static''
and ''Dynamic''.'
enum:
- Static
- Dynamic
type: string
x-ms-enum:
modelAsString: true
name: IPAllocationMethod
publicIPPrefix:
description: Reference to another subresource.
properties:
id:
description: Resource ID.
type: string
x-ms-azure-resource: true
resourceGuid:
description: The resource GUID property of the public IP resource.
type: string
PublicIPAddressSku:
description: SKU of a public IP address
properties:
name:
description: Name of a public IP address SKU.
enum:
- Basic
- Standard
type: string
x-ms-enum:
modelAsString: true
name: PublicIPAddressSkuName
host: management.azure.com
info:
description: The Microsoft Azure Network management API provides a RESTful set of
web services that interact with Microsoft Azure Networks service to manage your
network resources. The API has entities that capture the relationship between
an end user and the Microsoft Azure Networks service.
title: NetworkManagementClient
version: "2018-08-01"
x-apisguru-categories:
- cloud
x-logo:
url: https://assets.onestore.ms/cdnfiles/onestorerolling-1606-01000/shell/v3/images/logo/microsoft.png
x-origin:
- format: swagger
url: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/network/resource-manager/Microsoft.Network/stable/2018-08-01/publicIpAddress.json
version: "2.0"
x-preferred: false
x-providerName: azure.com
x-serviceName: network-publicIpAddress
x-tags:
- Azure
- Microsoft
paths:
/subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPAddresses:
get:
description: Gets all the public IP addresses in a subscription.
operationId: PublicIPAddresses_ListAll
parameters:
- description: Client API version.
in: query
name: api-version
required: true
type: string
- description: The subscription credentials which uniquely identify the Microsoft
Azure subscription. The subscription ID forms part of the URI for every
service call.
in: path
name: subscriptionId
required: true
type: string
responses:
"200":
description: Request successful. The operation returns a list of PublicIPAddress
resources.
schema:
$ref: '#/definitions/PublicIPAddressListResult'
tags:
- PublicIPAddresses
x-ms-examples:
List all public IP addresses:
parameters:
api-version: "2018-08-01"
subscriptionId: subid
responses:
"200":
body:
value:
- id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/testDNS-ip
location: westus
name: testDNS-ip
properties:
idleTimeoutInMinutes: 4
ipConfiguration:
id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testDNS649/ipConfigurations/ipconfig1
provisioningState: Succeeded
publicIPAddressVersion: IPv4
publicIPAllocationMethod: Dynamic
type: Microsoft.Network/publicIPAddresses
- id: /subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/publicIPAddresses/ip01
location: westus
name: ip01
properties:
dnsSettings:
domainNameLabel: testlbl
fqdn: testlbl.westus.cloudapp.azure.com
idleTimeoutInMinutes: 4
ipAddress: 40.85.154.247
ipConfiguration:
id: /subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/loadBalancers/testLb/frontendIPConfigurations/LoadBalancerFrontEnd
provisioningState: Succeeded
publicIPAddressVersion: IPv4
publicIPAllocationMethod: Dynamic
type: Microsoft.Network/publicIPAddresses
x-ms-pageable:
nextLinkName: nextLink
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses:
get:
description: Gets all public IP addresses in a resource group.
operationId: PublicIPAddresses_List
parameters:
- description: The name of the resource group.
in: path
name: resourceGroupName
required: true
type: string
- description: Client API version.
in: query
name: api-version
required: true
type: string
- description: The subscription credentials which uniquely identify the Microsoft
Azure subscription. The subscription ID forms part of the URI for every
service call.
in: path
name: subscriptionId
required: true
type: string
responses:
"200":
description: Request successful. The operation returns a list of PublicIPAddress
resources.
schema:
$ref: '#/definitions/PublicIPAddressListResult'
tags:
- PublicIPAddresses
x-ms-examples:
List resource group public IP addresses:
parameters:
api-version: "2018-08-01"
resourceGroupName: rg1
subscriptionId: subid
responses:
"200":
body:
value:
- id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/testDNS-ip
location: westus
name: testDNS-ip
properties:
idleTimeoutInMinutes: 4
ipConfiguration:
id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testDNS649/ipConfigurations/ipconfig1
ipTags:
- ipTagType: FirstPartyUsage
tag: SQL
- ipTagType: FirstPartyUsage
tag: Storage
provisioningState: Succeeded
publicIPAddressVersion: IPv4
publicIPAllocationMethod: Dynamic
type: Microsoft.Network/publicIPAddresses
- id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/ip03
location: westus
name: ip03
properties:
dnsSettings:
domainNameLabel: testlbl
fqdn: testlbl.westus.cloudapp.azure.com
idleTimeoutInMinutes: 4
ipAddress: 40.85.154.247
ipConfiguration:
id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/testLb/frontendIPConfigurations/LoadBalancerFrontEnd
provisioningState: Succeeded
publicIPAddressVersion: IPv4
publicIPAllocationMethod: Dynamic
type: Microsoft.Network/publicIPAddresses
x-ms-pageable:
nextLinkName: nextLink
? /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}
: delete:
description: Deletes the specified public IP address.
operationId: PublicIPAddresses_Delete
parameters:
- description: The name of the resource group.
in: path
name: resourceGroupName
required: true
type: string
- description: The name of the subnet.
in: path
name: publicIpAddressName
required: true
type: string
- description: Client API version.
in: query
name: api-version
required: true
type: string
- description: The subscription credentials which uniquely identify the Microsoft
Azure subscription. The subscription ID forms part of the URI for every
service call.
in: path
name: subscriptionId
required: true
type: string
responses:
"200":
description: Delete successful.
"202":
description: Accepted and the operation will complete asynchronously.
"204":
description: Request successful. Resource does not exist.
tags:
- PublicIPAddresses
x-ms-examples:
Delete public IP address:
parameters:
api-version: "2018-08-01"
publicIpAddressName: test-ip
resourceGroupName: rg1
subscriptionId: subid
responses:
"200": {}
"202": {}
"204": {}
x-ms-long-running-operation: true
get:
description: Gets the specified public IP address in a specified resource group.
operationId: PublicIPAddresses_Get
parameters:
- description: The name of the resource group.
in: path
name: resourceGroupName
required: true
type: string
- description: The name of the subnet.
in: path
name: publicIpAddressName
required: true
type: string
- description: Client API version.
in: query
name: api-version
required: true
type: string
- description: The subscription credentials which uniquely identify the Microsoft
Azure subscription. The subscription ID forms part of the URI for every
service call.
in: path
name: subscriptionId
required: true
type: string
- description: Expands referenced resources.
in: query
name: $expand
required: false
type: string
responses:
"200":
description: Request successful. The operation returns the resulting PublicIPAddress
resource.
schema:
$ref: '#/definitions/PublicIPAddress'
tags:
- PublicIPAddresses
x-ms-examples:
Get public IP address:
parameters:
api-version: "2018-08-01"
publicIpAddressName: testDNS-ip
resourceGroupName: rg1
subscriptionId: subid
responses:
"200":
body:
id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/testDNS-ip
location: westus
name: testDNS-ip
properties:
idleTimeoutInMinutes: 4
ipConfiguration:
id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testDNS649/ipConfigurations/ipconfig1
ipTags:
- ipTagType: FirstPartyUsage
tag: SQL
- ipTagType: FirstPartyUsage
tag: Storage
provisioningState: Succeeded
publicIPAddressVersion: IPv4
publicIPAllocationMethod: Dynamic
type: Microsoft.Network/publicIPAddresses
patch:
description: Updates public IP address tags.
operationId: PublicIPAddresses_UpdateTags
parameters:
- description: The name of the resource group.
in: path
name: resourceGroupName
required: true
type: string
- description: The name of the public IP address.
in: path
name: publicIpAddressName
required: true
type: string
- description: Parameters supplied to update public IP address tags.
in: body
name: parameters
required: true
schema:
description: Tags object for patch operations.
properties:
tags:
additionalProperties:
type: string
description: Resource tags.
type: object
- description: Client API version.
in: query
name: api-version
required: true
type: string
- description: The subscription credentials which uniquely identify the Microsoft
Azure subscription. The subscription ID forms part of the URI for every
service call.
in: path
name: subscriptionId
required: true
type: string
responses:
"200":
description: Update successful. The operation returns the resulting PublicIPAddress
resource.
schema:
$ref: '#/definitions/PublicIPAddress'
tags:
- PublicIPAddresses
x-ms-examples:
Update public IP address tags:
parameters:
api-version: "2018-08-01"
parameters:
tags:
tag1: value1
tag2: value2
publicIpAddressName: test-ip
resourceGroupName: rg1
subscriptionId: subid
responses:
"200":
body:
id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip
location: westus
name: testDNS-ip
properties:
idleTimeoutInMinutes: 10
ipConfiguration:
id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testDNS649/ipConfigurations/ipconfig1
provisioningState: Succeeded
publicIPAddressVersion: IPv4
publicIPAllocationMethod: Static
tags:
tag1: value1
tag2: value2
type: Microsoft.Network/publicIPAddresses
x-ms-long-running-operation: true
put:
description: Creates or updates a static or dynamic public IP address.
operationId: PublicIPAddresses_CreateOrUpdate
parameters:
- description: The name of the resource group.
in: path
name: resourceGroupName
required: true
type: string
- description: The name of the public IP address.
in: path
name: publicIpAddressName
required: true
type: string
- description: Parameters supplied to the create or update public IP address
operation.
in: body
name: parameters
required: true
schema:
$ref: '#/definitions/PublicIPAddress'
- description: Client API version.
in: query
name: api-version
required: true
type: string
- description: The subscription credentials which uniquely identify the Microsoft
Azure subscription. The subscription ID forms part of the URI for every
service call.
in: path
name: subscriptionId
required: true
type: string
responses:
"200":
description: Update successful. The operation returns the resulting PublicIPAddress
resource.
schema:
$ref: '#/definitions/PublicIPAddress'
"201":
description: Create successful. The operation returns the resulting PublicIPAddress
resource.
schema:
$ref: '#/definitions/PublicIPAddress'
tags:
- PublicIPAddresses
x-ms-examples:
Create public IP address DNS:
parameters:
api-version: "2018-08-01"
parameters:
location: eastus
properties:
dnsSettings:
domainNameLabel: dnslbl
publicIpAddressName: test-ip
resourceGroupName: rg1
subscriptionId: subid
responses:
"200":
body:
id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip
location: eastus
name: testDNS-ip
properties:
dnsSettings:
domainNameLabel: dnslbl
fqdn: dnslbl.westus.cloudapp.azure.com
idleTimeoutInMinutes: 4
ipConfiguration:
id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testDNS649/ipConfigurations/ipconfig1
provisioningState: Succeeded
publicIPAddressVersion: IPv4
publicIPAllocationMethod: Dynamic
type: Microsoft.Network/publicIPAddresses
"201":
body:
id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip
location: eastus
name: testDNS-ip
properties:
dnsSettings:
domainNameLabel: dnslbl
fqdn: dnslbl.westus.cloudapp.azure.com
idleTimeoutInMinutes: 4
ipConfiguration:
id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testDNS649/ipConfigurations/ipconfig1
provisioningState: Succeeded
publicIPAddressVersion: IPv4
publicIPAllocationMethod: Dynamic
type: Microsoft.Network/publicIPAddresses
Create public IP address allocation method:
parameters:
api-version: "2018-08-01"
parameters:
location: eastus
properties:
idleTimeoutInMinutes: 10
publicIPAddressVersion: IPv4
publicIPAllocationMethod: Static
sku:
name: Standard
publicIpAddressName: test-ip
resourceGroupName: rg1
subscriptionId: subid
zones:
- "1"
responses:
"200":
body:
id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip
location: eastus
name: testDNS-ip
properties:
idleTimeoutInMinutes: 10
ipConfiguration:
id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testDNS649/ipConfigurations/ipconfig1
provisioningState: Succeeded
publicIPAddressVersion: IPv4
publicIPAllocationMethod: Static
sku:
name: Standard
type: Microsoft.Network/publicIPAddresses
zones:
- "1"
"201":
body:
id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip
location: eastus
name: testDNS-ip
properties:
idleTimeoutInMinutes: 10
ipConfiguration:
id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testDNS649/ipConfigurations/ipconfig1
provisioningState: Succeeded
publicIPAddressVersion: IPv4
publicIPAllocationMethod: Static
sku:
name: Standard
type: Microsoft.Network/publicIPAddresses
zones:
- "1"
Create public IP address defaults:
parameters:
api-version: "2018-08-01"
parameters:
location: eastus
publicIpAddressName: test-ip
resourceGroupName: rg1
subscriptionId: subid
responses:
"200":
body:
id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip
location: eastus
name: testDNS-ip
properties:
idleTimeoutInMinutes: 4
ipConfiguration:
id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testDNS649/ipConfigurations/ipconfig1
provisioningState: Succeeded
publicIPAddressVersion: IPv4
publicIPAllocationMethod: Dynamic
sku:
name: Basic
type: Microsoft.Network/publicIPAddresses
"201":
body:
id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip
location: eastus
name: testDNS-ip
properties:
idleTimeoutInMinutes: 4
ipConfiguration:
id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testDNS649/ipConfigurations/ipconfig1
provisioningState: Succeeded
publicIPAddressVersion: IPv4
publicIPAllocationMethod: Dynamic
sku:
name: Basic
type: Microsoft.Network/publicIPAddresses
x-ms-long-running-operation: true
produces:
- application/json
schemes:
- https
security:
- azure_auth:
- user_impersonation
securityDefinitions:
azure_auth:
authorizationUrl: https://login.microsoftonline.com/common/oauth2/authorize
description: Azure Active Directory OAuth2 Flow
flow: implicit
scopes:
user_impersonation: impersonate your user account
type: oauth2
Hi @HiranyaKavishani, thanks for you issue report, please try fixing this part: ? /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName} : delete:
and let us know if that helps.
I think this is very much related, https://github.com/OpenAPITools/openapi-generator/issues/7453 . In the provided repo, swagger-parser will return null for both swagger and messages fields
I tested this locally, reorganizing the ? /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName} : delete:
and removing the ?
and parsed ok.
I just wrote some tests against the latest origin/master and they all pass for the issue I was mentioning earlier, but fail for the latest released version. It looks like once a new version is out my problem will be resolved.
Hi @gracekarina
The swagger parser should validate the YAML and report the errors in the message field to convey the error. Your thoughts?
Thanks, Mohammed