No change without setting swagger2customizer.. I'll let it rest for a day..
On Thu, Nov 30, 2017 at 1:30 PM, nino martinez wael < [email protected]> wrote: > yup have set skip.default.json.provider.registration.. > > But no matter what I do it has no effect on what the swagger feature > generates.. Where it's changing the json provider or removing it all > together.. > > Trying it now without setting swagger2Customizer.. > > > On Thu, Nov 30, 2017 at 1:04 PM, Sergey Beryozkin <[email protected]> > wrote: > >> Just FYI, removing Jettison lib will ensure it's not auto-installed by >> CXF, and if it is not possible to remove then the other option is to set >> a "skip.default.json.provider.registration" bus property. >> >> However it's not related to Swagger at all, Jettison if installed will >> only affect the way JSON is generated for service responses >> >> Sergey >> >> On 30/11/17 11:57, nino martinez wael wrote: >> >>> It does not seem to be a jettison problem.. And neither an problem with >>> jackson versions, I just wiped all jettison and jackson(except 2.9.1 ) >>> versions from my running environment.. >>> >>> Looking into of it could be something with JacksonJaxbJsonProvider vs >>> JacksonJsonProvider >>> >>> On Thu, Nov 30, 2017 at 12:45 PM, nino martinez wael < >>> [email protected]> wrote: >>> >>> IS there somewhere while on runtime where I can print current registered >>>> providers for cxf, I have a feeling that it somehow are using jettison >>>> for >>>> json... >>>> >>>> On Thu, Nov 30, 2017 at 12:17 PM, nino martinez wael < >>>> [email protected]> wrote: >>>> >>>> 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 < >>>>> [email protected]> >>>>> 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 < >>>>>>> [email protected]> 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 < >>>>>>>> [email protected]> 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<MinimalContact> contactList=new ArrayList<>(); >>>>>>>>> >>>>>>>>> public List<MinimalContact> getMinimalContacts() { >>>>>>>>> return contactList; >>>>>>>>> } >>>>>>>>> >>>>>>>>> public void setMinimalContacts(List<MinimalContact> >>>>>>>>> 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 >>>>> >>>>> >>>> >>>> >>>> -- >>>> Best regards / Med venlig hilsen >>>> Nino Martinez >>>> >>>> >>> >>> >>> > > > -- > Best regards / Med venlig hilsen > Nino Martinez > -- Best regards / Med venlig hilsen Nino Martinez
