Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
protodef-yaml
Advanced tools
Transforms YAML-like syntax to ProtoDef JSON schema and HTML documentation. See a live demo!
npm install -g protodef-yaml
protodef-yaml <input yaml file> <output json file> # generate json
protodef-yaml <input yaml file> <output html file> # generate docs
or through npx,
npx protodef-yaml input.yml
npx protodef-yaml input.yml docs.html
See API.md
Refer to this documentation, also see test/ for example files
Example input:
ScoreEntries:
type: u8 =>
0: change
1: remove
entries: []varint
scoreboard_id: zigzag64
objective_name: string
score: li32
optional?: bool
_: type?
if remove:
entry_type: i8 =>
1: player
2: entity
3: fake_player
_: entry_type?
if player or entity:
entity_unique_id: zigzag64
if fake_player:
custom_name: string
Output
{
"ScoreEntries": [
"container",
[
{
"name": "type",
"type": [
"mapper",
{
"type": "u8",
"mappings": {
"0": "change",
"1": "remove"
}
}
]
},
{
"name": "entries",
"type": [
"array",
{
"countType": "varint",
"type": [
"container",
[
{
"name": "scoreboard_id",
"type": "zigzag64"
},
{
"name": "objective_name",
"type": "string"
},
{
"name": "score",
"type": "li32"
},
{
"name": "optional",
"type": [
"option",
"bool"
]
},
{
"anon": true,
"type": [
"switch",
{
"compareTo": "../type",
"fields": {
"remove": [
"container",
[
{
"name": "entry_type",
"type": [
"mapper",
{
"type": "i8",
"mappings": {
"1": "player",
"2": "entity",
"3": "fake_player"
}
}
]
},
{
"anon": true,
"type": [
"switch",
{
"compareTo": "entry_type",
"fields": {
"player": [
"container",
[
{
"name": "entity_unique_id",
"type": "zigzag64"
}
]
],
"entity": [
"container",
[
{
"name": "entity_unique_id",
"type": "zigzag64"
}
]
],
"fake_player": [
"container",
[
{
"name": "custom_name",
"type": "string"
}
]
]
},
"default": "void"
}
]
}
]
]
},
"default": "void"
}
]
}
]
]
}
]
}
]
]
}
The differences to YAML:
You can also embed JSON for custom ProtoDef types as usual, for example:
string: ["pstring", {"countType": "i32"}]
Note: the parser only supports this at a root level. To use nested json inside yaml, you can encapsulate a JSON array with a single quote. For example:
SomeType:
some_string: '["pstring", {"countType": "i32"}]'
FAQs
Transforms YAML-like syntax to ProtoDef JSON schema
The npm package protodef-yaml receives a total of 337 weekly downloads. As such, protodef-yaml popularity was classified as not popular.
We found that protodef-yaml demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.