Skip to content

Compare generated and manually JSON files #183

@tomschr

Description

@tomschr

Situation

Currently, our internal configuration repo contains many JSON files that were crafted manually.

The goal is to have these JSON files generated by docbuild.

Use Case

Writers don't need to care of all the details of having a valid and syntactically correct JSON file. In the past it was a challenge to provide changes not only to the Docserv XML config, but also reflect these changes manually in the JSON.

With the help of docbuild, this tedious task becomes obsolete.

Possible Implementation

  1. Clone the GL://susedoc/docserv-config.

  2. Pick one JSON file from the json-portal-dsc folder, for example sles/16.0.json.

  3. Run docbuild to generate the metadata:

     docbuild --env-config=env.devel.toml metadata `sles/16.0/en-us''
    

    The result will be saved, for example, in /var/cache/docbuild/doc-example-com/meta/sles/16.0.json.

  4. Compare the two files side-by-side. Either manually or by an appropriate tool (maybe https://jsondiff.com/?)

Differences can occur:

  • A different order in .documents. That should be fine.
  • A different key would be an error.
  • A different value could be an error. That depends on the datatype.

We need to collect the differences to ensure they are the same. They don't have to be byte-identical, but have the same structure, keys etc.

Relationship

See #155

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions