Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-98472

Missing @JSON annotation in sample-service-builder-portlet

    Details

      Description

      In liferay-plugins here https://github.com/liferay/liferay-plugins/blob/7.0.x/portlets/sample-service-builder-portlet/docroot/WEB-INF/src/com/liferay/sampleservicebuilder/model/impl/FooModelImpl.java#L498-L507 the isField2() method needs the @JSON annotations just like the getField2() method above it.

              @JSON
      	@Override
      	public boolean getField2() {
      		return _field2;
      	}
      
      	@Override
      	public boolean isField2() {
      		return _field2;
      	}

      needs to be changed to this

              @JSON
      	@Override
      	public boolean getField2() {
      		return _field2;
      	}
      
              @JSON
      	@Override
      	public boolean isField2() {
      		return _field2;
      	}

      Some customers have been using this as an example to build their own service-builder portlets and their boolean fields are unable to be returned by the JSONWS API as per the comment on this PR/commit: https://github.com/brianchandotcom/liferay-portal/pull/40070/commits/7b5d5b6df88557f08c999098031144282a4d48b2

      I know that liferay-plugins is no longer maintained but customers are using it as an example and it is causing them problems.

        Attachments

          Activity

            People

            Assignee:
            summer.zhang Summer Zhang
            Reporter:
            william.nealeigh William Nealeigh
            Participants of an Issue:
            Recent user:
            Summer Zhang
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              1 year, 51 weeks, 5 days ago

                Packages

                Version Package
                7.0.X