Skip to content

If binding two required metadata to api, will fail if only provide one custom-properties using cli to create api #37

@hellyzh

Description

@hellyzh

Describe the bug

If binding two required metadata to api, will fail if only provide one custom-properties using cli to create api. There are two Required properties testschema and testschema2 for following sample:
image

Related command

az apic api create -g hlytest424 --service-name hlyservice424 --api-id apitest3 --title "test api 2" --type rest --contacts "[{email:[email protected],name:test,url:example.com}]" --custom-properties '{"testschema2":"testvalue"}' --description "API description" --external-documentation "[{title:'onboarding docs',url:example.com}]" --license "{url:example.com}" --summary "summary"

Errors

(ValidationError) Metadata doesn't match the defined schema.
Code: ValidationError
Message: Metadata doesn't match the defined schema.
Exception Details: (None) Required properties are missing from object: testschema.
Code: None
Message: Required properties are missing from object: testschema.

Issue script & Debug output

(ValidationError) Metadata doesn't match the defined schema.
Code: ValidationError
Message: Metadata doesn't match the defined schema.
Exception Details: (None) Required properties are missing from object: testschema.
Code: None
Message: Required properties are missing from object: testschema.

Expected behavior

ok

Environment Summary

azure-cli 2.59.0

core 2.59.0
telemetry 1.1.0

Extensions:
apic-extension 1.0.0b5

Dependencies:
msal 1.27.0
azure-mgmt-resource 23.1.0b2

Python location '/opt/az/bin/python3'
Extensions directory '/home/helly/.azure/cliextensions'

Python (Linux) 3.11.8 (main, Mar 27 2024, 04:03:04) [GCC 11.4.0]

Legal docs and information: aka.ms/AzureCliLegal

Your CLI is up-to-date.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions