Uploaded image for project: 'OpenMRS Core'
  1. OpenMRS Core
  2. TRUNK-2205

Jackson JSON cannot handle BaseOpenmrsObject

    XMLWordPrintable

Details

    Description

      We have defined both isVoided() and getVoided() methods in BaseOpenmrsData (and isRetired() and getRetired() in BaseOpenmrsMetadata), which is technically not right according to bean specifications. The Jackson JSON library bombs on this, like:

      Caused by: java.lang.IllegalArgumentException: Conflicting getter definitions 
      for property "voided": org.openmrs.BaseOpenmrsData#isVoided(0 params) vs 
      org.openmrs.BaseOpenmrsData#getVoided(0 params)
      

      Selected approach (per the Design Forum on 15-Aug-2012):

      • Go through the API and find all methods with the signature "Boolean isXyz()", and for each of them:
        • Verify we have a correct "Boolean getXyz()" method
        • Deprecate the incorrect isXyz() method, saying to use the getXyz() method instead
        • Add the @JsonIgnore annotation to the incorrect isXyz method

      It may be possible to salvage Saptarshi's attached patch here, but given the amount of time that has passed since he wrote it, it may be easier to just re-do the work against trunk.

      Gliffy Diagrams

        Attachments

          Issue Links

            Activity

              People

                ivange94 Ivange Larry Ndumbe
                mseaton Mike Seaton
                Daniel Kayiwa Daniel Kayiwa
                Votes:
                0 Vote for this issue
                Watchers:
                9 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  Time Tracking

                    Estimated:
                    Original Estimate - 4 hours
                    4h
                    Remaining:
                    Time Spent - 2 hours Remaining Estimate - 1 hour
                    1h
                    Logged:
                    Time Spent - 2 hours Remaining Estimate - 1 hour Time Not Required
                    2h