Azure / azure-sdk-for-go

This repository is for active development of the Azure SDK for Go. For consumers of the SDK we recommend visiting our public developer docs at:
https://docs.microsoft.com/azure/developer/go/
MIT License
1.63k stars 832 forks source link

SubscriptionRequired on apimanagement.APICreateOrUpdateParameter does not seem to work as expected. #5904

Closed codyseavey closed 5 years ago

codyseavey commented 5 years ago

Bug Report

This is the setting that was expected to be unchecked in the API.

Screen Shot 2019-09-27 at 10 32 02 AM
ArcturusZhang commented 5 years ago

Hi @codyseavey I just tried this api with similar code you posted here, everything is fine. I tweaked your code a little bit.

apiParameters := &apimanagement.APICreateOrUpdateParameter{
        APICreateOrUpdateProperties: &apimanagement.APICreateOrUpdateProperties{
            DisplayName:          &apiName,
            Value:                &content,
            // Format:               apimanagement.Openapijson, // I removed this to by pass the constraints
            Path:                 &apiName,
            Protocols:            &[]apimanagement.Protocol{"https"},
            SubscriptionRequired: to.BoolPtr(false), // you will need to import "github.com/Azure/go-autorest/autorest/to" here
        },
    }

After executed this piece of code, I use rest api GET to verify the SubscriptionRequired field, which is false. Please have a try. If you have further questions, please feel free to comment below, I will reopen this issue then.

ghost commented 5 years ago

Thanks for working with Microsoft on GitHub! Tell us how you feel about your experience using the reactions on this comment.