Azure / api-center

Provide feedback, request features, and report issues for Azure API Center.
MIT License
30 stars 5 forks source link

Provide object property docs for` az apic api update --custom-properties` + example #20

Open neilpeterson opened 9 months ago

neilpeterson commented 9 months ago

I am trying to add custom data to an API with the Azure CLI and cannot get the shorthand syntax correct. Are there properties and / or examples that can be added to the CLI docs / help to assist?

CLI help output

PS > az apic api update --custom-properties ??

Argument
    --custom-properties : Object
        The custom metadata defined for API catalog entities.
        See https://github.com/Azure/azure-cli/tree/dev/doc/shorthand_syntax.md for more about
        shorthand syntax.

Object Properties

I've tried several things, based on the REST spec this seems most likely. Notes, the API schema has been updated to include internal_id.

az apic api update -g $API_CENTER_RESOURCE_GROUP_NAME -s $API_CENTER_INSTANCE_NAME -w default --name $APICAPIName --custom-properties "{properties:{internal_id:'3c3544e5-d623-4650-aaa4-b06c5467f162'}}"

However, this results in the following error.

Failed to parse '--custom-properties' argument: Shorthand Syntax Error: Expect character ',' or ']':
        {properties:[internal_id:

Thanks a bunch.

neilpeterson commented 9 months ago

Regardless of updating the docs, any hint here would be helpful. Struggling to get this working :)

juliajuju93 commented 6 months ago

@neilpeterson : thanks for the feedback. in our latest CLI release we are providing better examples on how to use az apic api update. Please let us know if this solves your issues