Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a bug where JSON content is not always validated #804

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Commits on Feb 14, 2023

  1. Fix a bug where an JSON content is not validated

    Motivation:
    
    If an invalid JSON content is submitted to Central Dogma Server using
    REST API, the JSON is not validated and it is saved as is.
    
    The file content is formatted as a text so `node.get("content")` returns
    `TextNode` and it is regarded as a string although it is a JSON object.
    https://github.com/line/centraldogma/blob/9030505a928006d32f3897dc08823dac0d5fd6c2/server/src/main/java/com/linecorp/centraldogma/server/internal/api/converter/ChangesRequestConverter.java#L91-L95
    
    Modifications:
    
    - Pass a raw text value to `Change.ofJsonUpsert()` and make an invalidid
      JSON validated.
    
    Result:
    
    Central Dogma server now correctly rejects an invalid JSON content.
    ikhoon committed Feb 14, 2023
    Configuration menu
    Copy the full SHA
    ec74064 View commit details
    Browse the repository at this point in the history
  2. Fix test

    ikhoon committed Feb 14, 2023
    Configuration menu
    Copy the full SHA
    2fe5aef View commit details
    Browse the repository at this point in the history

Commits on Feb 15, 2023

  1. Fix test errors

    ikhoon committed Feb 15, 2023
    Configuration menu
    Copy the full SHA
    15893eb View commit details
    Browse the repository at this point in the history

Commits on Mar 8, 2023

  1. Update server/src/test/java/com/linecorp/centraldogma/server/internal…

    …/api/ContentServiceV1Test.java
    ikhoon authored Mar 8, 2023
    Configuration menu
    Copy the full SHA
    2173a7e View commit details
    Browse the repository at this point in the history
  2. Update server/src/test/java/com/linecorp/centraldogma/server/internal…

    …/api/ContentServiceV1Test.java
    ikhoon authored Mar 8, 2023
    Configuration menu
    Copy the full SHA
    71d7817 View commit details
    Browse the repository at this point in the history

Commits on Mar 9, 2023

  1. Update server/src/test/java/com/linecorp/centraldogma/server/internal…

    …/api/ContentServiceV1Test.java
    
    Co-authored-by: minux <[email protected]>
    ikhoon and minwoox authored Mar 9, 2023
    Configuration menu
    Copy the full SHA
    0310e1e View commit details
    Browse the repository at this point in the history

Commits on Apr 10, 2023

  1. Merge branch 'main' of https://github.com/line/centraldogma into vali…

    …date-json-content
    jrhee17 committed Apr 10, 2023
    Configuration menu
    Copy the full SHA
    52938e9 View commit details
    Browse the repository at this point in the history