<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Tanisha Suyal</title>
    <description>The latest articles on DEV Community by Tanisha Suyal (@tanisha_suyal_8efb4a5b201).</description>
    <link>https://dev.to/tanisha_suyal_8efb4a5b201</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4078331%2F242153b8-cefc-47cd-9b54-940fb7bc6312.png</url>
      <title>DEV Community: Tanisha Suyal</title>
      <link>https://dev.to/tanisha_suyal_8efb4a5b201</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tanisha_suyal_8efb4a5b201"/>
    <language>en</language>
    <item>
      <title>'u' Replaced By 'U' Is A Big Error,Insight From My On Going Spring Boot Project</title>
      <dc:creator>Tanisha Suyal</dc:creator>
      <pubDate>Sat, 22 Aug 2026 16:42:25 +0000</pubDate>
      <link>https://dev.to/tanisha_suyal_8efb4a5b201/u-replaced-by-u-is-a-big-errorinsight-from-my-on-going-spring-boot-project-eo</link>
      <guid>https://dev.to/tanisha_suyal_8efb4a5b201/u-replaced-by-u-is-a-big-errorinsight-from-my-on-going-spring-boot-project-eo</guid>
      <description>&lt;p&gt;For Three days I was struck on running my Cart endpoints.Everything seems correct.&lt;br&gt;
But the Error on running the endpoint was :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"success"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"message"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"The given id must not be null"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"data"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Somewhere the ID was becoming null before it reaches the repository even when i was passing the Id.&lt;/p&gt;

&lt;h2&gt;
  
  
  Project Explanation
&lt;/h2&gt;

&lt;p&gt;Let me first clear the endpoints and scenario to you.&lt;br&gt;
I am Building an Full Fledged AI-aided E-com project using spring boot,OpenAI Models and BLIP-CLIP models for the Image-to-Text and Text-to-Image processing.&lt;/p&gt;

&lt;p&gt;Right now,I am creating the Entities,Repository,Services and Controllers for basic working of the website.&lt;br&gt;
I am also using DTO's for the structured data transfer.&lt;/p&gt;

&lt;p&gt;The problem started with Cart endpoints,my 'addToCart' service was not actually adding the products into the cart even when I was passing the values I was getting the id to be null.&lt;/p&gt;
&lt;h2&gt;
  
  
  Cart Endpoint
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;/cart/addToCart&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Request body&lt;br&gt;
application/json&lt;br&gt;
Example Value&lt;br&gt;
Schema&lt;br&gt;
{&lt;br&gt;
"userId": 9007199254740991,&lt;br&gt;
"productId": 9007199254740991,&lt;br&gt;
"quantity": 1073741824&lt;br&gt;
}&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Response&lt;br&gt;
{&lt;br&gt;
"success": boolean,&lt;br&gt;
"message": "string",&lt;br&gt;
"data": "string"&lt;br&gt;
}&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Error resolution
&lt;/h2&gt;

&lt;p&gt;I queried all the sources and I was getting more confused,Nothing Clearly was error there in my code yet the endpoints were not responsing.&lt;br&gt;
checklist :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fix Mapping Annotations&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;Use &lt;code&gt;@RequestBody&lt;/code&gt; for JSON data sent in a POST or PUT body.&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;@RequestParam&lt;/code&gt; for query parameters in the URL (like ?name=test).&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;@PathVariable&lt;/code&gt; for variables built directly into the URL path (like /users/{id}).&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Check Data Binding and Names&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Ensure your JSON property names match your Java class variable names exactly.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Verify that your DTO class has getter and setter methods (or use Lombok &lt;code&gt;@Data&lt;/code&gt; or &lt;code&gt;@Getter&lt;/code&gt;/&lt;code&gt;@Setter&lt;/code&gt;), which Jackson needs to read the data.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Check that the Content-Type header in your client request is set to application/json when sending a JSON body.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;
  
  
  Let me explain you these by example
&lt;/h2&gt;

&lt;p&gt;Lets take one example,we are creating a cart service in an e-com project and we have this controller for add to cart service.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;ResponseEntity&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;ApiResponse&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;addToCart&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nd"&gt;@RequestBody&lt;/span&gt; &lt;span class="nc"&gt;CartRequest&lt;/span&gt; &lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="o"&gt;){&lt;/span&gt;
        &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;service&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;addToCart&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

        &lt;span class="nc"&gt;ApiResponse&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
                &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;ApiResponse&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&amp;gt;(&lt;/span&gt;
                        &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
                        &lt;span class="s"&gt;"Added"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
                        &lt;span class="n"&gt;status&lt;/span&gt;
                &lt;span class="o"&gt;);&lt;/span&gt;

        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nc"&gt;ResponseEntity&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;ok&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With the response DTO as cartRequest as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;CartRequest&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;

    &lt;span class="nd"&gt;@NotNull&lt;/span&gt;
    &lt;span class="nd"&gt;@Positive&lt;/span&gt;
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="nc"&gt;Long&lt;/span&gt; &lt;span class="nc"&gt;UserId&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

    &lt;span class="nd"&gt;@NotNull&lt;/span&gt;
    &lt;span class="nd"&gt;@Positive&lt;/span&gt;
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="nc"&gt;Long&lt;/span&gt; &lt;span class="nc"&gt;ProductId&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

    &lt;span class="nd"&gt;@NotNull&lt;/span&gt;
    &lt;span class="nd"&gt;@Positive&lt;/span&gt;
    &lt;span class="nd"&gt;@Min&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="nc"&gt;Integer&lt;/span&gt; &lt;span class="nc"&gt;Quantity&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Everything is in sync right?&lt;/p&gt;

&lt;p&gt;Congrats! you have hit the error.&lt;br&gt;
Remember?&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Ensure your JSON property names match your Java class variable names exactly.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This is the error I was struck into, this the 'u' replaced with 'U'.Notice the Capital letter at the beginning of the the DTO variables.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;CartRequest&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;

    &lt;span class="nd"&gt;@NotNull&lt;/span&gt;
    &lt;span class="nd"&gt;@Positive&lt;/span&gt;
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="nc"&gt;Long&lt;/span&gt; &lt;span class="o"&gt;~~&lt;/span&gt;&lt;span class="nc"&gt;UserId&lt;/span&gt;&lt;span class="o"&gt;;~~&lt;/span&gt;

    &lt;span class="nd"&gt;@NotNull&lt;/span&gt;
    &lt;span class="nd"&gt;@Positive&lt;/span&gt;
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="nc"&gt;Long&lt;/span&gt; &lt;span class="o"&gt;~~&lt;/span&gt;&lt;span class="nc"&gt;ProductId&lt;/span&gt;&lt;span class="o"&gt;;~~&lt;/span&gt;

    &lt;span class="nd"&gt;@NotNull&lt;/span&gt;
    &lt;span class="nd"&gt;@Positive&lt;/span&gt;
    &lt;span class="nd"&gt;@Min&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="nc"&gt;Integer&lt;/span&gt; &lt;span class="o"&gt;~~&lt;/span&gt;&lt;span class="nc"&gt;Quantity&lt;/span&gt;&lt;span class="o"&gt;;~~&lt;/span&gt;

&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  What I learned
&lt;/h2&gt;

&lt;p&gt;Conventions Matters and not every advice and error handling will be provided to you as such.&lt;br&gt;
keep Things in mind and follow conventions for devlopment.&lt;/p&gt;

</description>
      <category>backend</category>
      <category>debugging</category>
      <category>java</category>
      <category>springboot</category>
    </item>
  </channel>
</rss>
