Skip to content

Add is_json function #32

@RaeesFatima

Description

@RaeesFatima

Validate if string is valid JSON.

Examples:
print(is_json('{"name": "Alice", "age": 25}')) -> True (object with string + number)
print(is_json("{name: 'Alice', age: 25}")) -> False (keys must be in double quotes, strings must use double quotes)

Instructions:

  1. Create the function in validators.py
  2. See and follow the used pattern
  3. Write test cases.
  4. Please do update the documentation too, github link: documentation link

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions