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

Ability to establish known struct key order #240

Open
brandtkeller opened this issue May 29, 2024 · 1 comment
Open

Ability to establish known struct key order #240

brandtkeller opened this issue May 29, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@brandtkeller
Copy link
Member

Is your feature request related to a problem? Please describe.

Order of the fields in tooling that consumes go-oscal was mentioned as a point of confusion for the generation of artifacts. Would like to test if it is possible to define ordered structs for the top level models.

Describe the solution you'd like

  • Given Generation of a model
  • When a new model is written to a file
  • Then the order of the model fields is deterministic and ordered as intended

Describe alternatives you've considered

non-critical change

Additional context

Establish some error checking to ensure we capture drift when model is updated with new or different fields.

@brandtkeller brandtkeller added the enhancement New feature or request label May 29, 2024
@github-actions github-actions bot added the triage Awaiting triage from the team label May 29, 2024
@brandtkeller brandtkeller removed the triage Awaiting triage from the team label Jul 9, 2024
@brandtkeller brandtkeller self-assigned this Aug 2, 2024
@brandtkeller
Copy link
Member Author

Current Discovery - establishing struct key order for fields requires additional input data or hard-coded values.

hard-coding the order is not scalable and introduces a lot of potential for drift and additional work on each release and update of OSCAL schemas.

The JSON schema - for which go-oscal uses to-date has no precedence towards the order of keys (and the order which specified in the schema is not the preferred order).

Using the XSD with the JSON schema provided an option towards fully-generated types with keys ordered - but the differences between the XML schema and the JSON schema presented issues with regards to natively supporting both.

At this time I believe integrating further complexity for generate and the inclusion of XSD to not be aligned with greater library support of XML as a first-class format. As such we should defer this for review in work done in #12 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: 📋 Backlog
Development

Successfully merging a pull request may close this issue.

1 participant