FHIR Chat · Swagger document · implementers

Stream: implementers

Topic: Swagger document


view this post on Zulip Yunwei Wang (Jun 26 2018 at 19:52):

How can I generate Swagger document from my own CapabilityStatement? What tool should I use?

view this post on Zulip Eric Haas (Jun 26 2018 at 19:52):

ig-pub does it

view this post on Zulip Yunwei Wang (Jun 26 2018 at 19:56):

@Eric Haas Where can I find that tool? Thanks

view this post on Zulip Lloyd McKenzie (Jun 26 2018 at 20:00):

http://build.fhir.org/downloads.html

view this post on Zulip Eric Haas (Jun 26 2018 at 20:05):

IG Publisher The Implementation Guide Publishing Tool (see IG Publishing documentation ) on http://build.fhir.org/downloads.html

view this post on Zulip Yunwei Wang (Jun 26 2018 at 20:05):

@Lloyd McKenzie @Eric Haas thanks!

view this post on Zulip Michele Mottini (Jun 26 2018 at 20:30):

the documentation of the Swagger generation says 'Note: this section is draft - the functionality described here is not yet implemented.' - is that wrong?

view this post on Zulip Lloyd McKenzie (Jun 26 2018 at 20:38):

I don't actually know...

view this post on Zulip Eric Haas (Jun 26 2018 at 21:51):

  • Define your CapabilityStatement in the IG and publish it
  • The ig-pub generates a file [capstatement id]-openapi.json in the output folder. e.g. server-openapi.json
  • You drag and drop that file in your nearest handy-dandy swagger editor like this one
  • c'est voila !
    Screen-Shot-2018-06-26-at-2.50.53-PM.png

  • ( actually a quite a few errors which you might have to hand edit away. I have not had a chance to investigate it beyond this.

view this post on Zulip Eric Haas (Jun 26 2018 at 21:53):

I think this the future of FHIR IG documentation where we merge the static narrative bits to the autogenerated api doco. But it means we need better CapStatements tools! :-/

view this post on Zulip Grahame Grieve (Jun 27 2018 at 04:11):

what kind of better tools do you need?

view this post on Zulip Eric Haas (Jun 27 2018 at 16:57):

I'm planning to try to build off of the source directory for an IG, Your tool is a good start and I'll play with it some more, but need a fully featured ui like Forge or spreadsheet friendly.

view this post on Zulip Jose Costa Teixeira (Jun 27 2018 at 16:59):

Tool for doing what?

view this post on Zulip Eric Haas (Jun 27 2018 at 17:01):

They are pretty tedious to build and a nice narrative is hard to generate I admit I gave up on the transform to generate the narrative. I hand edit the narrative first and use that to guide me in the creation of the resource

view this post on Zulip Grahame Grieve (Jun 27 2018 at 20:00):

have you used the toolkit to edit a capability statmeent?

view this post on Zulip Eric Haas (Jun 27 2018 at 20:30):

Yes and Your toolkit is a very good start but they get a lot more sophisticated quickly and I imagine even more so if drive api documentation off of them.

view this post on Zulip Grahame Grieve (Jun 28 2018 at 04:08):

can the toolkit be better?

view this post on Zulip John Moehrke (Jun 28 2018 at 13:16):

I use Grahame's tool for CapabilityStatements, but once I got the first complete cut... it is editing the xml in Notepad++...

view this post on Zulip Yunwei Wang (Jul 23 2018 at 02:54):

Another question. I have the swagger json generated from IG publishing tool. When I load it to swagger editor, I cannot get response model. The error message is cannot fetch http://build.fhir.org/fhir.json.schema/definitions/ValueSet. I got 404 when I put that url in browser. So what url shold I put as schema.$ref in swagger?

view this post on Zulip Grahame Grieve (Jul 23 2018 at 03:01):

you can't use URLs to resolve json schema documents. It's just how it's designed - that's what the json schema guys tell me. you have to load the json schemas into the context first


Last updated: Apr 12 2022 at 19:14 UTC