I'm facing some problems regarding the publication GREG using Swagger. I wonder if you have any way to make GREG recognize the JSON Schema, because I saw that it only recognizes XML Schema which ends up forcing me to use WADL.
-
I have 2 files. One swagger file and the other is a json schema. My swagger file uses my json schema as a object model. I know that if I import an swagger file in Greg it works without problem. But, if I need to import a swagger file that depends on a json schema file, Greg wont work because it just recognize the swagger file and not the json file. With a wsdl I can do it good. I can import a wsdl with a xsd file e Greg recognizes both. How can I do it with swagger and Greg? – Vitor Darela Oct 19 '16 at 12:32
2 Answers
I presume you are using G-Reg 4 series which does not have Swagger support. However, in G-Reg 5 series WSO2 have enabled this and you can find the latest version which is G-Reg 5.3.0 from here. Other than that, new G-Reg offers you some more very useful features to enhance SOA governance capabilities.
Adding a SOAP service using a Swagger
To enable json schema you have to create a handler. Please refer below sample media type handlers available in greg(carbon-registry)
Please find this useful article which will teach you how to create a simple handler.

- 16,415
- 8
- 80
- 90
-
I have 2 files. One swagger file and the other is a json schema. My swagger file uses my json schema as a object model. I know that if I import an swagger file in Greg it works without problem. But, if I need to import a swagger file that depends on a json schema file, Greg wont work because it just recognize the swagger file and not the json file. With a wsdl I can do it good. I can import a wsdl with a xsd file e Greg recognizes both. How can I do it with swagger and Greg? – Vitor Darela Oct 19 '16 at 12:32
You can find information regarding the support given for swagger in WSO2 Governance Registry in the following documentation.
Note: As mentioned in @thusharaK s answer, these capabilities are available in the latest version of the product.

- 496
- 6
- 24
-
I have 2 files. One swagger file and the other is a json schema. My swagger file uses my json schema as a object model. I know that if I import an swagger file in Greg it works without problem. But, if I need to import a swagger file that depends on a json schema file, Greg wont work because it just recognize the swagger file and not the json file. With a wsdl I can do it good. I can import a wsdl with a xsd file e Greg recognizes both. How can I do it with swagger and Greg? – Vitor Darela Oct 19 '16 at 12:32
-
Currently, WSO2 Governance Registry doesn't support importing JSON schemas. You need to modify the [`SwaggerMediaTypeHandler`](https://github.com/wso2/carbon-registry/blob/7a7ef5b9998bd46f5be3fd2684951991bfc51386/components/registry/org.wso2.carbon.registry.extensions/src/main/java/org/wso2/carbon/registry/extensions/handlers/SwaggerMediaTypeHandler.java) in order to achieve this task. – madawa Oct 20 '16 at 03:55