Forum Discussion

saikiran11's avatar
saikiran11
Visitor
6 years ago

Integrate Swagger with FHIR HAPI models

I would like to create an FHIR API using swagger. Is there any way to specify custom models and parser (HAPI models and HAPI model parsers) in the swagger.yaml file.
These response models are defined in the HAPI libraries (hapi-fhir-structures-dstu3). I would like to generate API code using swagger-codegen with the models defined in the HAPI library.

2 Replies

  • nmrao's avatar
    nmrao
    Champion Level 3
    Interesting topic. Never heard such use case.

    Are you sure that HAPI does not have any existing swagger definitions of their own? If so, possible to use that?
  • Hi!

     

    Currently custom models are not being supported. The generated code will work with models defined in swagger definition document (the yaml/json file). You can build a definition adding FHIR HAPI models and can generate projects in differents with codegen v2 and v3.