@stoplight/yaml

WebJar for @stoplight/yaml

License

License

Apache-2.0
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

stoplight__yaml
Last Version

Last Version

4.2.1
Release Date

Release Date

Type

Type

jar
Description

Description

@stoplight/yaml
WebJar for @stoplight/yaml
Project URL

Project URL

https://www.webjars.org
Source Code Management

Source Code Management

https://github.com/stoplightio/yaml

Download stoplight__yaml

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/stoplight__yaml/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>stoplight__yaml</artifactId>
    <version>4.2.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/stoplight__yaml/
implementation 'org.webjars.npm:stoplight__yaml:4.2.1'
// https://jarcasting.com/artifacts/org.webjars.npm/stoplight__yaml/
implementation ("org.webjars.npm:stoplight__yaml:4.2.1")
'org.webjars.npm:stoplight__yaml:jar:4.2.1'
<dependency org="org.webjars.npm" name="stoplight__yaml" rev="4.2.1">
  <artifact name="stoplight__yaml" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='stoplight__yaml', version='4.2.1')
)
libraryDependencies += "org.webjars.npm" % "stoplight__yaml" % "4.2.1"
[org.webjars.npm/stoplight__yaml "4.2.1"]

Dependencies

compile (4)

Group / Artifact Type Version
org.webjars.npm : stoplight__ordered-object-literal jar [1.0.1,2)
org.webjars.npm : stoplight__types jar [11.9.0,12)
org.webjars.npm : stoplight__yaml-ast-parser jar [0.0.48]
org.webjars.npm : tslib jar [1.12.0,2)

Project Modules

There are no modules declared in this project.

@stoplight/yaml

Maintainability Test Coverage

Useful functions when working with YAML.

Installation

Supported in modern browsers and node.

# latest stable
yarn add @stoplight/yaml

Usage

// basic example of parseWithPointers
import { parseWithPointers } from "@stoplight/yaml";

const result = parseWithPointers("foo: bar");

console.log(result.data); // => the {foo: "bar"} JS object
// basic example of getJsonPathForPosition and getLocationForJsonPath
import { getJsonPathForPosition, getLocationForJsonPath, parseWithPointers } from "@stoplight/yaml";

const result = parseWithPointers(`hello: world
address:
    street: 123`
);

const path = getJsonPathForPosition(result, { line: 2, character: 7 }); // line and character are 0-based
console.log(path); // -> ["address", "street"];

const position = getLocationForJsonPath(result, ['address']);
console.log(position.range.start); // { line: 1, character: 8 } line and character are 0-based
console.log(position.range.end); // { line: 2, character: 15 } line and character are 0-based

Contributing

  1. Clone repo.
  2. Create / checkout feature/{name}, chore/{name}, or fix/{name} branch.
  3. Install deps: yarn.
  4. Make your changes.
  5. Run tests: yarn test.prod.
  6. Stage relevant files to git.
  7. Commit: yarn commit. NOTE: Commits that don't follow the conventional format will be rejected. yarn commit creates this format for you, or you can put it together manually and then do a regular git commit.
  8. Push: git push.
  9. Open PR targeting the next branch.
org.webjars.npm

Stoplight

Stoplight leverages your OpenAPI documents to drive the entire API development process

Versions

Version
4.2.1