Uploaded image for project: 'Spring Data REST'
  1. Spring Data REST
  2. DATAREST-117

@JsonIgnore and other Jackson annotations are ignored

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: None
    • Fix Version/s: 2.0 GA (Codd)
    • Component/s: None
    • Labels:
      None

      Description

      Github Author: speedyg
      Github Last-Updated: 2013-08-21T10:01:31Z
      This issue was automatically imported from github

      In my application and in the example application the @JsonIgnore annotation is ignored.

      Reproduce:
      Add an @JsonIgnore annotation to the field status in Order.java. The status field should not be serialized.
      Call http://localhost:8080/restbucks/orders/1

      The status property is (still) exported.

      Also tried @JsonIgnoreProperties and @XmlTransient, no effect.

      Additionally, i am not able to find another way to exclude a property.

        Activity

        Hide
        nickweedon Nick Weedon added a comment -

        By the way, I just wanted to say thanks for readdressing this issue. I have been battling with a rather inflexible REST client and these changes have allowed me to properly integrate with SDR. It saddened me to think that I might have to abandon SDR and go back to manually marshaling JSON data. Thanks again, really appreciate it

        Show
        nickweedon Nick Weedon added a comment - By the way, I just wanted to say thanks for readdressing this issue. I have been battling with a rather inflexible REST client and these changes have allowed me to properly integrate with SDR. It saddened me to think that I might have to abandon SDR and go back to manually marshaling JSON data. Thanks again, really appreciate it
        Hide
        gregturn Greg Turnquist added a comment -

        @Nick I'm glad we put SDR back onto a solid foundation and it's serving your needs.

        If you have test cases that expose problems, feel free to post them possibly as a pull request on Github. You can flag stuff as "DON'T MERGE" at the top, and then provide more details. We can chat back and forth, and if it pans out as a real bug, we can then fashion a real JIRA issue and work towards fixing stuff. This let's us use github's "review" model handily.

        In general, we need test cases to expose these problems, and as you've seen recently, this project is moving heavily towards a test-then-fix direction, compared to where it was perhaps a year ago. Narrow, focused test cases help us knock out issues and your involvement is great at moving things along.

        As a side note, I'm working on the first of what may be many getting started guides (http://spring.io/guides) for SDR. I hope we can lower the bar and make it easier for others to start using it as well.

        Show
        gregturn Greg Turnquist added a comment - @Nick I'm glad we put SDR back onto a solid foundation and it's serving your needs. If you have test cases that expose problems, feel free to post them possibly as a pull request on Github. You can flag stuff as "DON'T MERGE" at the top, and then provide more details. We can chat back and forth, and if it pans out as a real bug, we can then fashion a real JIRA issue and work towards fixing stuff. This let's us use github's "review" model handily. In general, we need test cases to expose these problems, and as you've seen recently, this project is moving heavily towards a test-then-fix direction, compared to where it was perhaps a year ago. Narrow, focused test cases help us knock out issues and your involvement is great at moving things along. As a side note, I'm working on the first of what may be many getting started guides ( http://spring.io/guides ) for SDR. I hope we can lower the bar and make it easier for others to start using it as well.
        Hide
        nickweedon Nick Weedon added a comment -

        @Greg I just flagged my #136 pull request with "DON'T MERGE" but i'm not sure if I have done this correctly. I simply suffixed the title with "DON'T MERGE", is this what you mean? I couldn't seem to find any other way to do this. This pull request includes the unit tests that reproduce the problem by the way.

        I like the test driven approach. It seems to work particularly well with developer to developer interaction. On that note, this has been an interesting experience for me since my usual means of collaboration include work meetings or chatting to someone over a cubicle divider

        Thanks for letting me know about the getting started guides too. I'll definitely take a look some time.

        If you like, I'd be happy to contribute to the guide in the area of integrating spring security since I found that I had to do a fair bit of web searching and general tinkering in this area to get this to work with my web application. There is still one area of this subject that I still need to find a solution to however (relates to discussion in DATAREST-236, Sri's problem with the findOne method).

        Show
        nickweedon Nick Weedon added a comment - @Greg I just flagged my #136 pull request with "DON'T MERGE" but i'm not sure if I have done this correctly. I simply suffixed the title with "DON'T MERGE", is this what you mean? I couldn't seem to find any other way to do this. This pull request includes the unit tests that reproduce the problem by the way. I like the test driven approach. It seems to work particularly well with developer to developer interaction. On that note, this has been an interesting experience for me since my usual means of collaboration include work meetings or chatting to someone over a cubicle divider Thanks for letting me know about the getting started guides too. I'll definitely take a look some time. If you like, I'd be happy to contribute to the guide in the area of integrating spring security since I found that I had to do a fair bit of web searching and general tinkering in this area to get this to work with my web application. There is still one area of this subject that I still need to find a solution to however (relates to discussion in DATAREST-236 , Sri's problem with the findOne method).
        Hide
        tilalilalou Romain Fromi added a comment -

        This was only fixed for @JsonIgnore annotation, not for all Jackson annotations.

        For example, in my project I configured Jackson to ignore all property without annotations :
        spring.jackson.mapper.auto_detect_getters: false
        spring.jackson.mapper.auto_detect_is_getters: false

        The problem is that @JsonValue and @JsonProperty are ignored by Data REST, therefore I cannot serialize anything.

        I chose to reopen this issue because the title states "other Jackson annotations" as well as @JsonIgnore, correct me if that was wrong.
        Thanks for reading!

        Show
        tilalilalou Romain Fromi added a comment - This was only fixed for @JsonIgnore annotation, not for all Jackson annotations. For example, in my project I configured Jackson to ignore all property without annotations : spring.jackson.mapper.auto_detect_getters: false spring.jackson.mapper.auto_detect_is_getters: false The problem is that @JsonValue and @JsonProperty are ignored by Data REST, therefore I cannot serialize anything. I chose to reopen this issue because the title states "other Jackson annotations" as well as @JsonIgnore, correct me if that was wrong. Thanks for reading!
        Hide
        olivergierke Oliver Gierke added a comment -

        Please don't re-open tickets that have been marked as resolved against an already released version. Feel free to open a new ticket that summarizes what you're still missing.

        Show
        olivergierke Oliver Gierke added a comment - Please don't re-open tickets that have been marked as resolved against an already released version. Feel free to open a new ticket that summarizes what you're still missing.

          People

          • Assignee:
            olivergierke Oliver Gierke
            Reporter:
            thomasd Thomas Darimont
            Last updater:
            Oliver Gierke
          • Votes:
            2 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Agile