Return-Path: X-Original-To: apmail-cxf-users-archive@www.apache.org Delivered-To: apmail-cxf-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0494017446 for ; Tue, 3 Mar 2015 22:48:31 +0000 (UTC) Received: (qmail 50466 invoked by uid 500); 3 Mar 2015 22:20:17 -0000 Delivered-To: apmail-cxf-users-archive@cxf.apache.org Received: (qmail 50402 invoked by uid 500); 3 Mar 2015 22:20:17 -0000 Mailing-List: contact users-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@cxf.apache.org Delivered-To: mailing list users@cxf.apache.org Received: (qmail 50390 invoked by uid 99); 3 Mar 2015 22:20:16 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Mar 2015 22:20:16 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of sberyozkin@gmail.com designates 209.85.212.181 as permitted sender) Received: from [209.85.212.181] (HELO mail-wi0-f181.google.com) (209.85.212.181) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Mar 2015 22:19:51 +0000 Received: by wiwl15 with SMTP id l15so26487479wiw.5 for ; Tue, 03 Mar 2015 14:19:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=BhE7OPw6q4dJaQe8XayLLyNYD7dKdGPrJCxcuizYu7w=; b=vKVscnt8Oi8ksG1ZzHtkn9dDevLdpso2FRrheSGHTfc8qu95Rkd83jg27npgdUgJp5 k8Q0+8JyLEz4RpM0W+DZQQoWuTDxgu6Vk6aaF8iboR3oKzzQS/hR+aSgBN4kNLrxvN8s 8rCmIlY4Js1qXb3DqTh4gFtl1z6ADeAHBGSlze9yClhNXghhvJq8Z7SiSUlcjeIWzCQu wVeZVkroSQcj+a6tWq5CJWboLK9Xjlb/JnoKZs4u+W4EtYt31X1SuqkNwXw3O7FYUveB ny75lK9/icQKGDuU94Zr1+RLpHozIFqRpVIOAjcxDPyiebhM9hSDxi53z964CxuwUKiw V+ow== X-Received: by 10.194.177.132 with SMTP id cq4mr1580239wjc.99.1425421190208; Tue, 03 Mar 2015 14:19:50 -0800 (PST) Received: from [192.168.2.7] ([89.101.102.96]) by mx.google.com with ESMTPSA id hv5sm3190540wjb.16.2015.03.03.14.19.48 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Mar 2015 14:19:49 -0800 (PST) Message-ID: <54F63373.5080108@gmail.com> Date: Tue, 03 Mar 2015 22:19:31 +0000 From: Sergey Beryozkin User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: users@cxf.apache.org Subject: Re: JSON schema in WADL References: In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org Hi Mandy Thanks for experimenting, "schemaLocations" points to resources which are assumed to be XML schemas and these schemas are read as XML. I've actually created a JIRA few days ago to support inlining JSON schemas but for now schemaLocations is assumed to point to XML schemas only. Use an "externalLinks" property, see https://git-wip-us.apache.org/repos/asf?p=cxf.git;a=blob;f=rt/rs/description/src/test/java/org/apache/cxf/jaxrs/model/wadl/WadlGeneratorJsonTest.java;h=cf368062059d21624cab45bd7614c6789c02f41e;hb=HEAD Another option is to use WADL XML as usual but set a 'linkAnyMediaTypeToXmlSchema' property, so you'd see representations of type JSON linked to XML schema elements - which is semantically not correct but can give a good idea to users what properties a JSON request or response may have... We have also started supporting Swagger - which can be good for describing JSON only services Cheers, Sergey On 03/03/15 21:48, Mandy Warren wrote: > Hi, > > I recently read Sergey's blog (http://sberyozkin.blogspot.co.uk/2011/10/describing-json-services-in-wadl.html​) about support for JSON Wadls and managed to view a wadl in JSON but am still struggling to link the JSON schema to the wadl. My spring config looks as follows:- > > > > > classpath:/json.schema > > > > > > > > > > > > > > > > > > > > > > When I try & access the wadl I get this error: > > 21:23:47.048 Could not determine bean name for instance of class org.apache.cxf.bus.managers.ServerRegistryImpl. > com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '{' (code 123) in prolog; expected '<' > at [row,col {unknown-source}]: [1,1] > at com.ctc.wstx.sr.StreamScanner.throwUnexpectedChar(StreamScanner.java:647) > at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2054) > at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1131) > at org.apache.cxf.staxutils.StaxUtils.readDocElements(StaxUtils.java:1353) > at org.apache.cxf.staxutils.StaxUtils.readDocElements(StaxUtils.java:1247) > at org.apache.cxf.staxutils.StaxUtils.read(StaxUtils.java:1174) > at org.apache.cxf.staxutils.StaxUtils.read(StaxUtils.java:1163) > at org.apache.cxf.staxutils.StaxUtils.read(StaxUtils.java:1109) > at org.apache.cxf.jaxrs.ext.xml.XMLSource.setBuffering(XMLSource.java:75) > at org.apache.cxf.jaxrs.model.wadl.WadlGenerator.loadSchemasIntoCache(WadlGenerator.java:1770) > at org.apache.cxf.jaxrs.model.wadl.WadlGenerator.setSchemaLocations(WadlGenerator.java:1752) > > Any idea what I am missing? > > Many thanks > > Mandy > > -- Sergey Beryozkin Talend Community Coders http://coders.talend.com/ Blog: http://sberyozkin.blogspot.com