-
Notifications
You must be signed in to change notification settings - Fork 82
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
Type change of double quoted strings of booleans/integers (and other issues) #144
Comments
the With the currently released version PS /home/gabriel> $yamlText = @'
>> ### YamlMime:BusinessCentralApplicationObject
>> fqName: '"Dummy"'
>> sourceTableType:
>> internalReference: O:Table::Microsoft#Foundation#Navigate#Document_Entry
>> name: Microsoft.Foundation.Navigate."Document Entry"
>> isExternal: false
>> objectProperties:
>> - name: ApplicationArea
>> value: '#All'
>> promoted: false
>> - name: DeleteAllowed
>> value: "False"
>> promoted: false
>> - name: SourceTable
>> value: "265"
>> promoted: true
>> xrefType:
>> internalReference: O:Table::Microsoft#Foundation#Navigate#Document_Entry
>> name: Microsoft.Foundation.Navigate."Document Entry"
>> isExternal: false
>> methods:
>> - syntax:
>> content: procedure SetSelectItemsMode()
>> summary: |-
>> Set the page in the "Select Items" Mode. This means that after the "Find" Button ist used, a item list will appear where the user can choose one or more items.
>>
>> After closing the item list page this page will also close and over the filter for the seleceted items can be retrieved through procedure "GetItemSelectionFilter()"
>> name: SetSelectItemsMode
>> uid: M:Page::M365_Navigate_SearchAttributes.SetSelectItemsMode
>> commentId: O:Page::M365 Navigate SearchAttributes
>> name: '"M365 Navigate SearchAttributes"'
>> uid: O:Page::M365_Navigate_SearchAttributes
>> '@;
PS /home/gabriel> cfy -Ordered $yamlText | cty
fqName: '"Dummy"'
sourceTableType:
internalReference: O:Table::Microsoft#Foundation#Navigate#Document_Entry
name: Microsoft.Foundation.Navigate."Document Entry"
isExternal: false
objectProperties:
- name: ApplicationArea
value: '#All'
promoted: false
- name: DeleteAllowed
value: "False"
promoted: false
- name: SourceTable
value: "265"
promoted: true
xrefType:
internalReference: O:Table::Microsoft#Foundation#Navigate#Document_Entry
name: Microsoft.Foundation.Navigate."Document Entry"
isExternal: false
methods:
- syntax:
content: procedure SetSelectItemsMode()
summary: |-
Set the page in the "Select Items" Mode. This means that after the "Find" Button ist used, a item list will appear where the user can choose one or more items.
After closing the item list page this page will also close and over the filter for the seleceted items can be retrieved through procedure "GetItemSelectionFilter()"
name: SetSelectItemsMode
uid: M:Page::M365_Navigate_SearchAttributes.SetSelectItemsMode
commentId: O:Page::M365 Navigate SearchAttributes
name: '"M365 Navigate SearchAttributes"'
uid: O:Page::M365_Navigate_SearchAttributes
PS /home/gabriel> get-Module powershell-yaml
ModuleType Version PreRelease Name ExportedCommands
---------- ------- ---------- ---- ----------------
Script 0.4.7 powershell-yaml {ConvertFrom-Yaml, ConvertTo-Yaml, cfy, cty} Types seem to be preserved. The only change I made to your Yaml is the Also, you shouldn't need to single quote an already double quoted string. Could you check which version of Also, I have been trying to get some feedback on an idea which has to do with modeling the data that gets deserialized into specific powershell types. If you're willing, would you mind having a look at: and potentially offer feedback on that PR? |
Thank you @gabriel-samfira ,
Indeed, you are right. |- keeps newline, >- removes newlines. I had mixed them up. I think the source (XML comments) is not passing this correctly here. I'll have another look at that.
I should have stayed in bed today. It was version 0.4.3. We are currently converting processes from PS5 to PS7. 0.4.3 was installed locally for PS5 (WindowsPowerShell), 0.4.7 globally in PS7 (PowerShell). I accidentally tested with 0.4.3, I'm really sorry! 0.4.7 works as expected. I will have a look at the PR later today. |
No worries! Glad it works! No rush or obligation to give any feedback on the above mentioned PR, unless you feel that it's inclusion might be useful or detrimental to your experience using the module. It's more of an exploratory PR to gauge if people would want something like that. It would live side by side with existing functionality. |
Hi there,
I have a kind of an issue with a datatype change causing a schema validation error later in doxfx. I am not fully sure if this is caused by PowerShell-Yaml or the underlying dll.
The used file is a stripped reference file generated by Microsoft ALDoc (Business Central, ERP). These files are usually fed into docfx to generate online help.
ORIGINAL ($yamlText):
RESULT ($newYamlText)
RESULT WITH COMMENTS
While I mentioned all issues I have found so far, the datatype conversion string to boolean ist the most annoying :)
What I've seen so far is, that the Node.Style is DoubleQuoted. I tried to handle it (surround with double quotes). That resulted in '"False"', single and double quoted. However, the validation was successful then.
The text was updated successfully, but these errors were encountered: