question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MINIMIZE_QUOTES Question

See original GitHub issue

Using MINIMIZE QUOTES with a custom serializer for YAML. I try this in the custom serializer

      jsonGenerator.writeString(resource.getId());

which outputs

   -appsec1234/34f3678c-1de8-45a4-a50d-3bb7c22b38/6f8caacc-b83c-4d55-993c-ad70ca5c1392


But then, if I add this

          jsonGenerator.writeString(resource.getTypeID() + " " + resource.getId());

I get

- '!host appsec1234/34f3678c-1de8-45a4-a50d-3bb7c22b38/6f8caacc-b83c-4d55-993c-ad70ca5c1392'

I need this to get output without quotes, am I missing something with how I pass these characters in? I read online about special characters causing this, can I serialize these in some way maybe to fix that issue?

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
mkkeffelercommented, Mar 25, 2021

So remember I said this.

I tried jsonGenerator.writerawvalue(resource.getTypeID() + " " + resource.getId());

but then get an error because YAMLGenerator doesn’t recognize that as a valid value for some reason

The error was that the generator didn’t recognize that as a valid way to start an object. So, I found this

        typeSer.writeTypePrefix(jsonGenerator, typeSer.typeId(resource, JsonToken.START_OBJECT));

Which writes the type of the object out, AND tells the generator that this is a START_OBJECT identifier. This ended up being one way I worked around the above issue.

0reactions
cowtowncodercommented, Mar 18, 2021

@mkkeffeler If you can give a basic reproduction, I can have a look. Factory should pass relevant settings to generator, yes; just make sure your ObjectMapper uses specific factory you have configured.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Minimize Quotes - BrainyQuote
The best way to minimize disagreement is to make sure that all the stakeholders are in the room. Share this Quote · Cheryl...
Read more >
Minimize your life, minimize your strife. | Quotable quotes ...
Jul 10, 2012 - Minimize your life, minimize your strife.
Read more >
Asking Questions Quotes & Sayings On Answers, Doubts
A collection of motivating, happy, and encouraging asking questions quotes, asking questions sayings, and asking questions proverbs.
Read more >
Avoiding Plagiarism - Quoting - Academic Integrity at MIT
When the words of an expert, authority, or relevant individual are particularly clear or expressive, you may want to quote them. Do not...
Read more >
How to avoid plagiarism when using direct quotation, indirect ...
Detailed Question -. I have problem understanding citation and palgiarism. I know that direct quotation is the exact word of the author, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found