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

Issue with loadYamlContent function #12279

Closed
kpanugan opened this issue Oct 26, 2023 Discussed in #12205 · 3 comments
Closed

Issue with loadYamlContent function #12279

kpanugan opened this issue Oct 26, 2023 Discussed in #12205 · 3 comments
Assignees

Comments

@kpanugan
Copy link

Discussed in #12205

Originally posted by kpanugan October 19, 2023
I am seeing the following issue when using loadYamlContent function in bicep file
var bicepObject = loadYamlContent('testVal.yaml')
output helloWorld object = bicepObject

where input is something simple

TopValues:
 labels:
   -keyName: "null"

The outputs i was expecting was

{
   "TopValues":{
     "labels":[{
        "keyName":"null"
     }]
    }
}

but i am getting it as

{
   "TopValues":{
     "labels":[{
        "keyName": null
     }]
    }
}

why is the value for "keyName" getting converted to a null instead of string which has null

@github-project-automation github-project-automation bot moved this to Todo in Bicep Oct 26, 2023
@kpanugan kpanugan changed the title Need help with loadYamlContent Issue with loadYamlContent function Oct 26, 2023
@alex-frankel
Copy link
Collaborator

@dciborow - can you take a look at this one?

@dciborow
Copy link
Collaborator

dciborow commented Nov 1, 2023

@kpanugan , per SharpYaml, to make it null, you can wrap it in double quotes ""null"".
xoofx/SharpYaml#106
xoofx/SharpYaml#112

@dciborow dciborow closed this as completed Nov 1, 2023
@github-project-automation github-project-automation bot moved this from Todo to Done in Bicep Nov 1, 2023
@kpanugan
Copy link
Author

kpanugan commented Nov 28, 2023

@dciborow
we cannot use two double quotes in yaml . I tried different variations

TopValues:
labels:
-keyName: ""null""

This is not allowed

TopValues:
labels:
-keyName: '"null"'

This produces a different output

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

3 participants