The reasons for not covering the full JSON Schema are available on many threads and github issues, so I won’t repeat those. The next version of the spec will support more of JSON Schema, but not all.
The keyword $schema is not supported. Also, what you have in there is the actual JSON Schema, where you’d need only what’s under the “definitions”. Having the $ref at the top level of your definitions completely negates anything else in there – by definition, any additional properties alongside $ref will be ignored by parsers. That applies to other places in your definitions as well. That’s the gist of it. Copying those files as-is to the editor will just not work. From: <[email protected]> on behalf of Virginie <[email protected]> Reply-To: "[email protected]" <[email protected]> Date: Tuesday, 9 May 2017 at 0:34 To: Swagger <[email protected]> Subject: Re: Integration with FHIR JSON schemas doesn't work Thanks Ron for your quick reply. I was not expecting you to go over all the files :-) However it would have been interesting to see in the swagger editor, the reason(s) why these schemas cannot be parsed. Can you point me to at least one example where these files are not valid schema objects according to the spec? I found the documentation listing the supported properties. It would have been interesting to also have the explicit list of not-supported properties/constructs. Are there upcoming changes to the spec to support more on JSON schema. Is there a reason why only a subset was supported? Op maandag 8 mei 2017 22:17:25 UTC+2 schreef Ron: Not really sure if you expect me to go over all the files you sent. Looking at a few – those are still not valid Schema Objects. They might be valid JSON Schema but the spec doesn’t support JSON Schema to its fullest. From: <[email protected]> on behalf of Virginie <[email protected]> Reply-To: "[email protected]" <[email protected]> Date: Monday, 8 May 2017 at 3:32 To: Swagger <[email protected]> Subject: Re: Integration with FHIR JSON schemas doesn't work Hi, I eventually took the complete schema-set locally, and reworked them based on JSON schema validation in Liquid Studio. I had to - remove the $id in each schema to keep reference-lookup local - remove self-references from some schemas to themselve JSON schema validation seems fine now. However I still run into the same issue with the Swagger editor: the editor makes the browser unreactive, nothing is displayed in the dev-console and the JSON structure is not shown in swagger-ui. I added in attachment the corrected schema-set in a zip. Tia for looking further into my problem! Op vrijdag 28 april 2017 20:21:46 UTC+2 schreef Ron: Putting aside that the entire schema there becomes invalid with one of the lines there, even if that one line was out, it’s still not a valid Schema Object in the spec. You can’t take it as-is and use it. From: <[email protected]> on behalf of Virginie <[email protected]> Reply-To: "[email protected]" <[email protected]> Date: Friday, 28 April 2017 at 5:47 To: Swagger <[email protected]> Subject: Integration with FHIR JSON schemas doesn't work Hello, We are trying to setup a new REST service using the international FHIR standard (Fast Health Interoperability Resources). More info on this: https://www.hl7.org/fhir/ However when integrating this into a swagger, we are not able to view the JSON structures in the UI. Our concrete example: swagger: '2.0' info: version: v1.0 title: API FHIR Consent basePath: /Consent consumes: - application/json+fhir produces: - application/json+fhir paths: /: get: tags: - Consent summary: 'Retrieve a patient consent' operationId: getConsent parameters: - name: patient in: query description: The identifier of the patient required: true type: integer format: int32 responses: '200': description: OK schema: title: Consent type: object items: $ref: '#/definitions/Consent' '403': description: Forbidden '404': description: NotFound deprecated: false definitions: Consent: { $ref: https://www.hl7.org/fhir/Consent.schema.json } To make this work through the browser, we disabled CORS verification with a plugin. The following issue is the $refs used in the original schema here above (https://www.hl7.org/fhir/Consent.schema.json), are sometimes dangling references. I will contact HL7 for this issue. We then copied the complete JSON schema set in local (also available here as a zip https://www.hl7.org/fhir/downloads.html or directly here https://www.hl7.org/fhir/fhir.schema.json.zip), corrected these issues and made these files available via a Mongoose HTTP server. But even then, I am not able to visualize anything in the Swagger UI. What is exactly the problem with these schemas? Is the problem lying within FHIR or is there an issue with the swagger UI? Tia for any help! -- You received this message because you are subscribed to the Google Groups "Swagger" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Swagger" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Swagger" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Swagger" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
