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.

Metadata API validation: validate root roles dictionary content

See original GitHub issue

Spec says this about root roles:

A role for each of “root”, “snapshot”, “timestamp”, and “targets” MUST be specified in the key list. The role of “mirror” is OPTIONAL.

The reference to “key list” seems like a mistake (maybe referring to an earlier design?) but the intent seems clear: the roles dictionary is allowed to contain either the roles for ["root", "snapshot", "timestamp", "targets"] or the roles for ["root", "snapshot", "timestamp", "targets", "mirror"] (and I suppose we are not going to implement mirror for now)). Other roles are not valid and not having the first four roles is not valid.

It makes sense to validate this in Root construction/deserialization.

Aside/thought: maybe it also makes sense to validate in serialization but I think documenting that roles dict is not intended to be modified goes a long way.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jkucommented, Oct 21, 2021

you don’t suggest doing that API change in this issue right?

I don’t: only reason to discuss these here is just in case they would make the validation obsolete… That doesn’t seem likely so let’s just forget it for now.

0reactions
MVrachevcommented, Oct 21, 2021

Okay, then I can fix this issue because it’s connected with another one I am already involved in #1356.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Metadata API Developer Guide
Metadata is data that describes other data. To understand how Salesforce defines metadata, contrast business data with Salesforce metadata.
Read more >
ValidationRule | Metadata API Developer Guide
A validation rule contains a formula or expression that evaluates the data in one or more fields and returns a value of true...
Read more >
Native API — Dataverse.org
Set whether the Dataverse collection is a metadata block facet root, or does it uses its parent metadata block facets. Possible values are...
Read more >
Content Management API | Contentful
Default values are not validated according to the field validations property. This means that they are applied to new entries even if they...
Read more >
OpenAPI Specification v3.1.0 | Introduction, Definitions, & More
As defined by the JSON Schema Validation vocabulary, data types can have an optional ... The object provides metadata about the API.
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