Cannot passing json string ttext with space
- Dominant language
- PowerShell
- Stars
- 45
- Forks
- 21
- Avg merge
- 21m
- Merged PRs (30d)
- 1
Description
# Description
I am trying to register an api with --custom-properties. It works fine until I add space in json string for .--custom-properties.
# Reproduction steps
Steps to reproduce the behavior:
using Powershell the below command is wont work if there is space between Sample Work. It works if the space is removed:
az apic api create --resource-group "rg-azintegration" `
--service-name "my-int-apic-npe" `
--api-id "newrestproductsystemwithallmetadata2" `
--title "2 My rest product system all metadata" `
--type "rest" `
--description "My product rest api metadata" `
--summary "short product api summary metadata" `
--custom-properties '{"TargetSystem":Sun,"Authentication":["SAML"],"IntergationId":"OnlyString1234","Entity":"Sample work"}'
However, if a set the Entity in --custom-properties to "Sample Work", adding space between Sample and Work it fails with the below error.
az : ERROR: Failed to parse '--custom-properties' argument: Shorthand Syntax Error: Please wrap whitespace
character in single quotes:
At line:4 char:1
+ az apic api create --resource-group "rt-syd-npe-arg-icc-devtest-azint ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (ERROR: Failed t... single quotes::String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
{TargetSystem:Sun,Authentication:[SAML],IntergationId:OnlyString1234,Entity:Sample
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
# Expected behavior
If I remove the space between the string SampleWork it works fine.
If applicable, add screenshots to help explain your problem.
# Additional context
Add any other context about the problem here.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.