Stream: IG creation
Topic: Use igpublisher to create json schema's
Hans van Amstel (Jul 29 2020 at 14:44):
Hi I am trying to create json schema files for the profiles we created. Is this possible for our own custom created profiles?
If possible is it some option in the ig.ini or something like this?
thanks in advance.
Lloyd McKenzie (Jul 29 2020 at 14:48):
@Grahame Grieve
Cees de Jonge (Jul 29 2020 at 15:03):
According the documentation: https://wiki.hl7.org/IG_Publisher_Documentation#HTML_Template the fragment could be generated setting property "json-schema" to true.
I tried this using "https://github.com/FHIR/test-template/blob/master/config.json" as inspiration, but the json-schema was not generated (yet), maybe I overlooked something.
Hans van Amstel (Jul 30 2020 at 12:49):
We want to use the json schema as payload description in openAPI yaml API description.
Jose Costa Teixeira (Jul 30 2020 at 12:57):
I'll want to look at openAPI also. I think @Eric Haas and @Gino Canessa have got this working?
Gino Canessa (Jul 30 2020 at 16:11):
I'm working on OpenAPI generation for the core specs right now (have plans to add profiles, but need the core working first).
In my experience, the files are very use-case dependent. For example, FHIR has circular references, which are not allowed in OpenAPI. To resolve, I have an option for how many levels the types get expanded, then truncate with object
. Going too many levels results in a large file, which some tooling rejects.
Tooling also appears to be particular about various conventions (and many tools disagree), so I'm trying to build in options for those.
Overall, I am confident in building out good tooling, but less confident in having things like canonical versions of the output.
David Pyke (Jul 30 2020 at 16:16):
Since OpenAPI is just horribly broken, I suggest you dump it for FHIR to FSH. It only makes sense. :grinning_face_with_smiling_eyes:
Eric Haas (Jul 30 2020 at 16:52):
OpenAPI has always been there and is available for all IGs not something I did. There is a link on the capabilitystatement page in the base templates/
Gino Canessa (Jul 30 2020 at 17:24):
Odd, I can't find any others that have it. That said, the file does not contain model information, just parameters.
Gino Canessa (Jul 30 2020 at 17:25):
Lol David. It's on my list
Grahame Grieve (Jul 30 2020 at 21:13):
The generated openAPI statements do not contain json schema for profiles. Maybe that's on the todo list for one day, but I've found the whole json schema/open api world impossible to navigate - the specs and tools all differ in unresolvable ways for me
Grahame Grieve (Jul 30 2020 at 21:14):
the existing openAPI generated documents reference a single schema which is http://hl7.org/fhir/fhir.schema.json
Gino Canessa (Jul 30 2020 at 21:25):
Yeah, I don't think it's possible to generate a (useful) canonical OpenAPI document, because the needs vary so much. I'm trying to build some flexible tooling that can generate what's needed on the fly instead.
Hans van Amstel (Jul 31 2020 at 09:16):
my current need is generating only the json schemas of the profiles something that is already done for the base profiles eg:https://www.hl7.org/fhir/patient.schema.json.html
I was looking for the ig templates to do something similar for our own custom profiles.
@Gino Canessa I believe it is possible to have a circular dependency in openAPI aslong as it is not infinite(by having mandatory (circular) dependent fields). Although from an openAPI spec it is allowed the swagger-ui does not like it :)
Gino Canessa (Jul 31 2020 at 15:21):
Yep, that's why I qualified my statement with useful :-) I know circular references are possible (it's how my definitions started), but if tooling doesn't accept it then it's not a useful file.
With all of that said, I don't have profile support in my tooling yet either. It is on the list though.
Last updated: Apr 12 2022 at 19:14 UTC