Stream: implementers
Topic: Forge R3 Save as JSON
Natasha Singh (Jul 17 2019 at 00:30):
Hey @Martijn Harthoorn I'm running Forge R3 on MacOS via wine. I've only been able to save my profiles in XML and haven't figured out how to save my profiles in JSON yet. Is there a way to do this?
Lloyd McKenzie (Jul 17 2019 at 01:22):
@Michel Rutten
Michel Rutten (Jul 18 2019 at 09:36):
Hi @Natasha Singh, actually JSON support has been implemented for a while, but the UI still needs to be updated (TODO). In order to force saving to JSON, manually rename the file extension in the Save dialog, e.g. change "profile.xml" to "profile.json".
Please note that duplicate profiles in multiple formats (xml & json) introduce ambiguity when resolving dependencies by canonical url. To prevent this, the Folder Browser always filters on a specific file type, as selected in the Open Folder dialog. The selection is persisted in the recent folder list. Other file type(s) are hidden from the UI and ignored when resolving dependencies. If you save a profile to the current folder using a different format than the active format, then the saved file will not be visible in the Folder Browser. To show the file, re-open the folder using the Open Folder command and select the other format.
Natasha Singh (Jul 18 2019 at 14:23):
Hey @Michel Rutten Hmm so I tried that approach but the file was still saved as XML. See below:
Screen-Shot-2019-07-18-at-10.21.58-AM.png
Michel Rutten (Jul 18 2019 at 14:25):
Which Forge release and version are you using? Did you fully replace the generated *.xml
extension?
Michel Rutten (Jul 18 2019 at 14:25):
(BTW this is just a hack/workaround, I really need to update the UI to support this in a user-friendly way)
Natasha Singh (Jul 18 2019 at 14:38):
Which Forge release and version are you using?
Screen-Shot-2019-07-18-at-10.38.16-AM.png
Natasha Singh (Jul 18 2019 at 14:40):
Also maybe worth noting that I tried your suggestion when creating a new derived StructureDefinition. I haven't tried Save As to convert from existing XML to JSON. Let me try that
Natasha Singh (Jul 18 2019 at 14:43):
Ok, I also trying doing Save As and that resulted in the same behavior as above. It still output an xml file
Michel Rutten (Jul 19 2019 at 09:21):
Weird, I cannot reproduce this...? Maybe this is related to Explorer Folder Options/Hide extensions:
pasted image
I always disable this setting.
Last updated: Apr 12 2022 at 19:14 UTC