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.

JSON obj examples stopped working after upgrading to 6.2.2

See original GitHub issue

Hi,

All the examples stopped working after upgrading from 5.1.0 to 6.2.2. I am attaching a screenshot of the broken example value which used to work before the upgrade.

image

And here is an excerpt of my validation rules.

        payload: {
          firstName: Joi.string().required()
            .description('First name of the buyer')
            .example('Joon-hee'),
          lastName: Joi.string()
            .description('Last name of the buyer')
            .example('Go'),
          email: Joi.string().email().required()
            .description('Email of the client')
            .example('joonhee@gmail.com'),
          minPrice: Joi.number().min(50000).integer()
            .required()
            .description('Minimum price')
            .example(2000000),
          maxPrice: Joi.number().min(100000).integer()
            .required()
            .description('Maximum price')
            .example(3000000),

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
glennjonescommented, Aug 25, 2016

Hi Yes I have been having problems with example property they are only valid in certain areas of the Swagger JSON. The plugin shares and reuse structures within the JSON to keeps its size small and increase the speed of parsing JOI objects. This means the shared object can be used both in a place where an example is allowed and also where it is not.

I am sorry about the regression here. I need to find a way to get this working again without breaking other complex internal caching and making sure the whole output is still valid against the Swagger spec.

0reactions
robmcguinnesscommented, Jun 5, 2020

Closing due to inactivity.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ConvertFrom-Json (Microsoft.PowerShell.Utility)
The ConvertFrom-Json cmdlet converts a JavaScript Object Notation (JSON) formatted string to a custom PSObject or Hashtable object that has a property for ......
Read more >
JSON.parse() not working - Stack Overflow
Your JsonObject seems is a Json Object. The reasons why you can't parse Json from a String: the String is surround by "...
Read more >
SyntaxError: JSON.parse: bad parsing - JavaScript | MDN
This string has to be valid JSON and will throw this error if incorrect syntax was encountered. Examples. JSON.parse() does not allow trailing...
Read more >
JSON Schema Serializer and Deserializer
This document describes how to use JSON Schema with the Apache Kafka® Java client and console tools. Both the JSON Schema serializer and...
Read more >
Invoking JSON Web Services - Liferay Help Center
This tutorial explains general techniques for working with JSON web ... When using numeric hints to match methods, not all of the parameters...
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