Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 4ACA0200D4C for ; Thu, 30 Nov 2017 12:17:22 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 497D7160BF4; Thu, 30 Nov 2017 11:17:22 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 690DC160BEA for ; Thu, 30 Nov 2017 12:17:21 +0100 (CET) Received: (qmail 40639 invoked by uid 500); 30 Nov 2017 11:17:15 -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 40627 invoked by uid 99); 30 Nov 2017 11:17:15 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 30 Nov 2017 11:17:15 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id C5DCD18082F for ; Thu, 30 Nov 2017 11:17:14 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.901 X-Spam-Level: X-Spam-Status: No, score=-0.901 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-2.8, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id 97uI1g-eMLYc for ; Thu, 30 Nov 2017 11:17:12 +0000 (UTC) Received: from mail-pf0-f177.google.com (mail-pf0-f177.google.com [209.85.192.177]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 4B0CD5F1ED for ; Thu, 30 Nov 2017 11:17:11 +0000 (UTC) Received: by mail-pf0-f177.google.com with SMTP id n6so2966551pfa.4 for ; Thu, 30 Nov 2017 03:17:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=4XA4TuLyD9Dxy85YFdedlXMB9JYvWEnGOb3BZyTlURI=; b=T3/2AGXbsrO+dMWLrNqZS9OSG+JbmitDUmGjjCdaBvJPvm8JoloNvPHJr5ls0QpNeZ RL88b+f9icRjh3sEmjHBMjMgXEgRTtUOFkHG2Tu2/0SkR6gg2mTmimvflkSKxZCI38gF Bj9OB0i1yAlReiwuW79+y5uvYcYVU5HLyEiGnjimD1X+uNzhTulKaWLZZWBDN07TPsue L9V8XvHPWqeX/2l/ISQE+9x1w37PfDSWxJS9+rkJ69dCqsmiof4XndNCLr8rMYgr355b 6dBtG/PngXO+hqea6bsptBxAF7arA7LsfGwDo7rK+nOwc9Bfs8kki/NAZBpHjJqlIJ2h N5rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=4XA4TuLyD9Dxy85YFdedlXMB9JYvWEnGOb3BZyTlURI=; b=ShIVXIiiYxRb8SfERh8rC03V1SAe/M4ahs5eVNb9hoenPEdXJvstOXPpKHs+6fDELo hpmA3ed2aG89wE5Y7iCkG5N9b+kTDqB3PM0jRUt9KI2wK+N4pe58vA6VP80t1Dza5fai b0QofZoEzs0ufQ82e2u16iAHXlrv1RL1HS9uSJPkHzBipvxfUFoGOMCRFy0QolMqSnGM FRjeMEisz/WkdGVqDgKYzHXdZxp3sfAs69myXR64vR+n2HdkMONo876Zn0g0weEtbbul aulmARymCmdpXs2DHrSE422sKfYodwBt9H+133njX8cis2HtmoBjh8aHfejyl1ZE343f AnvQ== X-Gm-Message-State: AJaThX7pme2Ea3TOK2lSXcqHot5mQH7dApyB1qO67eWnHFwRoNcODj15 AukTDJKGfxbw7Uocsy2N7RB83ozH7ZY7ynXjq18= X-Google-Smtp-Source: AGs4zMZGvioAggWJLyeHtCROUB2I+pkB4XBwjpydR0RXr0X3wj6Y0jUAlmy6R5AQD5bJg2NB/meO7GUng7oovpj1Mek= X-Received: by 10.98.109.65 with SMTP id i62mr6202015pfc.139.1512040629687; Thu, 30 Nov 2017 03:17:09 -0800 (PST) MIME-Version: 1.0 Received: by 10.100.144.87 with HTTP; Thu, 30 Nov 2017 03:17:09 -0800 (PST) In-Reply-To: References: From: nino martinez wael Date: Thu, 30 Nov 2017 12:17:09 +0100 Message-ID: Subject: Re: CXF 3.2.1 swagger generation are wrong for json To: users Content-Type: multipart/alternative; boundary="94eb2c11b1ec9e5a61055f316480" archived-at: Thu, 30 Nov 2017 11:17:22 -0000 --94eb2c11b1ec9e5a61055f316480 Content-Type: text/plain; charset="UTF-8" Okay I will check into libraries whats on class path.. I have the same gut feeling that it could be something like that. I have enunciate up and working on the side.. On Thu, Nov 30, 2017 at 11:18 AM, Sergey Beryozkin wrote: > Yes, the minor Swagger version caused this change, what was working 3.1.x, > specifically the serializers approach, was not working any longer with the > new Swagger version, hence this update. > > I honestly do not know why exactly a JAXB annotated bean is not correctly > represented in the Swagger-generated #definitions, it's obviously something > to do with the way Jackson and JAXB interacts. > Perhaps Jackson you register with DOSGI is not the same version installed > by the CXF swagger2 feature, perhaps some diff JAXB versions are involved, > please keep experimenting > > Sergey > > defaultSwagger2Serializers.setJavadocProvider(new JavaDocProvider()); >> swagger.setSwagger2Serializers(defaultSwagger2Serializers); >> >> I think this could be the same: >> >> Swagger2Customizer swagger2Customizer = new Swagger2Customizer(); >> swagger2Customizer.setJavadocProvider(new JavaDocProvider()); >> >> >> swagger.setCustomizer(swagger2Customizer); >> >> >> I have setup CXF to use JACKSON (JacksonJaxbJsonProvider) >> >> >> How can I tell swagger to do the same? I think that's the problem.. >> >> >> >> regards Nino >> >> >> >> >> On Thu, Nov 30, 2017 at 10:50 AM, nino martinez wael < >> nino.martinez.wael@gmail.com> wrote: >> >> Im wondering if this could be the problem : >>> >>> https://github.com/swagger-api/swagger-core/issues/960 >>> >>> On Thu, Nov 30, 2017 at 10:38 AM, nino martinez wael < >>> nino.martinez.wael@gmail.com> wrote: >>> >>> So I have a bean CXF accepts only this interpretation for my endpoint: >>>> >>>> { >>>> "contactList": [ >>>> { >>>> "campaignId": "2", >>>> "id":"", >>>> "indexNumber": "", >>>> "accountNumber": "232", >>>> "queueNumber": "0", >>>> "balance": 0, >>>> "personalIdentificationNumber1": "string", >>>> "firstName1": "string", >>>> "lastName1": "string", >>>> "personalIdentificationNumber2": "string", >>>> "firstName2": "string", >>>> "lastName2": "string", >>>> "address": "string", >>>> "zipCode": "string", >>>> "city": "string", >>>> "homePhone": "+4521", >>>> "mobilePhone": "+45122", >>>> "campaing": "string", >>>> "dateForExtract": "string" >>>> >>>> } >>>> ] >>>> } >>>> >>>> However the swagger feature are generating this as example: >>>> >>>> { >>>> "minimalContacts": [ >>>> { >>>> "campaignId": "string", >>>> "id": 0, >>>> "indexNumber": "string", >>>> "accountNumber": "string", >>>> "queueNumber": "string", >>>> "balance": 0, >>>> "personalIdentificationNumber1": "string", >>>> "firstName1": "string", >>>> "lastName1": "string", >>>> "personalIdentificationNumber2": "string", >>>> "firstName2": "string", >>>> "lastName2": "string", >>>> "address": "string", >>>> "zipCode": "string", >>>> "city": "string", >>>> "homePhone": "string", >>>> "mobilePhone": "string", >>>> "campaing": "string", >>>> "dateForExtract": "string" >>>> } >>>> ] >>>> } >>>> >>>> MinimalContactWrapper >>>> >>>> @XmlAccessorType(XmlAccessType.FIELD) >>>> @XmlRootElement(name = "contacts") >>>> public class MinimalContactWrapper { >>>> >>>> @XmlElementWrapper >>>> @XmlElementRef >>>> @Valid >>>> @NotNull >>>> @Size(min = 1) >>>> private List contactList=new ArrayList<>(); >>>> >>>> public List getMinimalContacts() { >>>> return contactList; >>>> } >>>> >>>> public void setMinimalContacts(List >>>> minimalContacts) { >>>> this.contactList = minimalContacts; >>>> } >>>> >>>> >>>> MinimalContact >>>> >>>> @XmlAccessorType(XmlAccessType.PROPERTY) >>>> @XmlRootElement(name="minimalcontact") >>>> public class MinimalContact { >>>> >>>> @NotNull >>>> @Size(min=1, max=240) >>>> private String campaignId; >>>> >>>> private Long id; >>>> @Size(min=1, max=240) >>>> private String indexNumber; >>>> @Size(min=1, max=20) >>>> @NotNull >>>> private String accountNumber; >>>> @Size(min=1, max=8) >>>> private String queueNumber; >>>> >>>> >>>> private Float balance; >>>> >>>> @Size(min=0, max=11) >>>> private String personalIdentificationNumber1; >>>> >>>> @Size(min=0, max=55) >>>> private String firstName1; >>>> >>>> @Size(min=0, max=55) >>>> private String lastName1; >>>> >>>> @Size(min=0, max=11) >>>> private String personalIdentificationNumber2; >>>> >>>> private String firstName2; >>>> >>>> private String lastName2; >>>> >>>> private String address; >>>> >>>> private String zipCode; >>>> private String city; >>>> >>>> @NotNull >>>> @Size(min=0, max=20) >>>> private String homePhone; >>>> >>>> @NotNull >>>> @Size(min=0, max=20) >>>> private String mobilePhone; >>>> >>>> private String campaing; >>>> >>>> @NotNull >>>> private String dateForExtract; >>>> >>>> >>>> >>>> >>>> >>>> >>>> -- >>>> Best regards / Med venlig hilsen >>>> Nino Martinez >>>> >>>> >>> >>> >>> -- >>> Best regards / Med venlig hilsen >>> Nino Martinez >>> >>> >> >> >> -- Best regards / Med venlig hilsen Nino Martinez --94eb2c11b1ec9e5a61055f316480--