chain-registry icon indicating copy to clipboard operation
chain-registry copied to clipboard

add `additionalProperties: false` to schemas

Open pyramation opened this issue 3 years ago • 4 comments

https://github.com/cosmos/chain-registry/blob/350840e766f7574a120760a13eda4c466413308a/testnets/stateset/assetlist.json#L24

pyramation avatar Sep 19 '22 22:09 pyramation

if we were to allow this, we could edit the schema. However, not sure we should from a graphics quality perspective.

pyramation avatar Sep 19 '22 22:09 pyramation

currently, there's something missing from most objects in the schema definitions, which is "additionalProperties": "false" . Once this is added ubiquitously throughout the schema (all objects), we should then stop seeing undefined properties, such as this 'jpeg'. On my todo list.

as for allowing jpegs, I actually think that should be fine.

JeremyParish69 avatar Sep 20 '22 20:09 JeremyParish69

ah that makes sense! We should add additionalProperties: false to nearly everything.

I know endpoints is one area, but still I think there is away to allow any key, but enforce the child schema. E.g. grpc-web maybe is not explicit in the schema, but the children { endpoints, archive, provider } would be enforced.

pyramation avatar Sep 21 '22 15:09 pyramation

I renamed the issue to focus on the root cause, if there is another, let's close this one.

pyramation avatar Sep 21 '22 16:09 pyramation