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

[Network] Required properties missing in response #755

Closed
veronicagg opened this issue Nov 22, 2016 · 5 comments
Closed

[Network] Required properties missing in response #755

veronicagg opened this issue Nov 22, 2016 · 5 comments
Labels
internal-ms Network P1 Service Attention Workflow: This issue is responsible by Azure service team.

Comments

@veronicagg
Copy link
Contributor

veronicagg commented Nov 22, 2016

Definition "LocalNetworkGateway" and "VirtualNetworkGateway" indicates "properties" is a required property, though response body for "VirtualNetworkGatewayConnections_List" doesn't contain it (based on .net recording Networks.Tests.GatewayOperationsTests/VirtualNetworkGatewayConnectionOperationsApisTest.json)

Scenario: VirtualNetworkGatewayConnectionOperationsApisTestGET5389

RESPONSE_BODY_VALIDATION_ERROR: Found errors in validating the response with statusCode "200" for example "VirtualNetworkGatewayConnectionOperationsApisTestGET5389" in operation "VirtualNetworkGatewayConnections_List".
InnerErrors:
  1. code: OBJECT_MISSING_REQUIRED_PROPERTY
    message: Missing required property: properties
    path: value,0,properties,localNetworkGateway2
    description: A common class for general resource information
  2. code: OBJECT_MISSING_REQUIRED_PROPERTY
    message: Missing required property: properties
    path: value,0,properties,virtualNetworkGateway1
    description: A common class for general resource information

"LocalNetworkGateway": {
      "properties": {
        "properties": {
          "x-ms-client-flatten": true,
          "$ref": "#/definitions/LocalNetworkGatewayPropertiesFormat"
        },
        "etag": {
          "type": "string",
          "description": "A unique read-only string that changes whenever the resource is updated."
        }
      },
      "allOf": [
        {
          "$ref": "#/definitions/Resource"
        }
      ],
      "required": [
        "properties"
      ],
      "description": "A common class for general resource information"
    }
"VirtualNetworkGateway": {
      "properties": {
        "properties": {
          "x-ms-client-flatten": true,
          "$ref": "#/definitions/VirtualNetworkGatewayPropertiesFormat"
        },
        "etag": {
          "type": "string",
          "description": "Gets a unique read-only string that changes whenever the resource is updated."
        }
      },
      "allOf": [
        {
          "$ref": "#/definitions/Resource"
        }
      ],
      "required": [
        "properties"
      ],
      "description": "A common class for general resource information"
    }
{
  "parameters": {
    "subscriptionId": "64229c92-175a-4eba-a2fd-ee1f9e29766e",
    "resourceGroupName": "csmrg7047",
    "api-version": "2016-09-01"
  },
  "responses": {
    "200": {
      "body": {
        "value": [
          {
            "name": "azsmnet5494",
            "id": "/subscriptions/64229c92-175a-4eba-a2fd-ee1f9e29766e/resourceGroups/csmrg7047/providers/Microsoft.Network/connections/azsmnet5494",
            "etag": "W/\"756cce66-58b3-42f9-a788-bd5ce73080b8\"",
            "type": "Microsoft.Network/connections",
            "location": "westus",
            "properties": {
              "provisioningState": "Succeeded",
              "resourceGuid": "ad3cc5ec-338b-42ab-a6c4-bfbf396a30a3",
              "virtualNetworkGateway1": {
                "id": "/subscriptions/64229c92-175a-4eba-a2fd-ee1f9e29766e/resourceGroups/csmrg7047/providers/Microsoft.Network/virtualNetworkGateways/azsmnet4830"
              },
              "localNetworkGateway2": {
                "id": "/subscriptions/64229c92-175a-4eba-a2fd-ee1f9e29766e/resourceGroups/csmrg7047/providers/Microsoft.Network/localNetworkGateways/azsmnet3822"
              },
              "connectionType": "IPsec",
              "routingWeight": 4,
              "ingressBytesTransferred": 0,
              "egressBytesTransferred": 0
            }
          }
        ]
      }
    }
  }
}

Other operations reporting same error are: "VirtualNetworkGatewayConnections_Get", "VirtualNetworkGatewayConnections_CreateOrUpdate" for "200" and "201" responses.

Responses for VirtualNetworkGatewayConnections_SetSharedKey should follow ConnectionSharedKey schema (which contains a required property) but body is empty based on [recording from .net](https://github.com/Azure/azure-sdk-for-net/blob/AutoRest/src/ResourceManagement/Network/Network.Tests/SessionRecords/Networks.Tests.GatewayOperationsTests/VirtualNetworkGatewayConnectionSharedKeyOperationsApisTest.json#L4730)

Operation: VirtualNetworkGatewayConnections_SetSharedKey

x-ms-examples

Scenario: VirtualNetworkGatewayConnectionSharedKeyOperationsApisTestPUT5290
INTERNAL_ERROR: An internal error occured while validating the response with statusCode "200" for example "VirtualNetworkGatewayConnectionSharedKeyOperationsApisTestPUT5290" in operation "VirtualNetworkGatewayConnections_SetSharedKey".
{ code: 'INTERNAL_ERROR',
message: 'An internal error occured while validating the response with statusCode "200" for example "VirtualNetworkGatewayConnectionSharedKeyOperationsApisTestPUT5290" in operation "VirtualNetworkGatewayConnections_SetSharedKey".',
innerErrors: [ { [Error: data cannot be null or undefined. It must be of a JSON object or a JSON array.] code: 'INTERNAL_ERROR' } ] }

@amarzavery
Copy link
Contributor

@Nilambari @DeepakRajendranMsft - Can you guys take a look at this issue as well?

@liumichelle
Copy link

@amitsriva - can you take a look at this please?
@DeepakRajendranMsft can you please assign this to Amit.

@liumichelle
Copy link

@MohitGargVpn can you take a look at this please?

@Nilambari
Copy link
Member

As specified in swagger, properties do get populated in case of GET for VirtualNetworkGateway/LocalNetworkGateway objects.
In case of GET of Connection object, its referened (VirtualNetworkGateway/LocalNetworkGateway) obeject's properies are not fully populated, it was as per design and changing this would be a breaking change and we will think of doing it in future but right now it is as per the design.
This is not a blocking issue as we do not use referenced objects for calling SET. Still, we can do SET on connection object with this returned connection object in response of GET connection.

Please let us know if you have further queries. Help up close this issue.

@salameer
Copy link
Member

@veronicagg

Please verify if this answers your questions and close accordingly

@bsiegel bsiegel added the Service Attention Workflow: This issue is responsible by Azure service team. label Sep 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal-ms Network P1 Service Attention Workflow: This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

10 participants