spectral
An open-source API style guide enforcer and linter.
Installation
dagger install github.com/sagikazarmark/daggerverse/spectral@v0.1.0
Entrypoint
Return Type
Spectral !
Arguments
Name | Type | Description |
---|---|---|
version | String | Version (image tag) to use from the official image repository as a base container. |
image | String | Custom image reference in "repository:tag" format to use as a base container. |
container | Container | Custom container to use as a base container. |
Example
dagger -m github.com/sagikazarmark/daggerverse/spectral@24c022dde505b24970824dd50f51e719098cfeb3 call \
func (m *myModule) example() *Spectral {
return dag.
Spectral()
}
@function
def example() -> dag.Spectral:
return (
dag.spectral()
)
@func()
example(): Spectral {
return dag
.spectral()
}
Types
Spectral 🔗
container() 🔗
Return Type
Container !
Example
dagger -m github.com/sagikazarmark/daggerverse/spectral@24c022dde505b24970824dd50f51e719098cfeb3 call \
container
func (m *myModule) example() *Container {
return dag.
Spectral().
Container()
}
@function
def example() -> dagger.Container:
return (
dag.spectral()
.container()
)
@func()
example(): Container {
return dag
.spectral()
.container()
}
lint() 🔗
Lint JSON/YAML documents.
Return Type
Container !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
documents | [File ! ] ! | - | JSON/YAML OpenAPI documents. |
ruleset | File ! | - | Ruleset file. |
failSeverity | String | - | Results of this level or above will trigger a failure exit code. (choices: "error", "warn", "info", "hint") (default "error") |
displayOnlyFailures | Boolean | - | Only output results equal to or greater than fail severity. |
resolver | File | - | Custom json-ref-resolver instance. |
encoding | String | - | Text encoding to use. (choices: "utf8", "ascii", "utf-8", "utf16le", "ucs2", "ucs-2", "base64", "latin1") (default "utf8") |
verbose | Boolean | - | Increase verbosity. |
quiet | Boolean | - | No logging, output only. |
Example
dagger -m github.com/sagikazarmark/daggerverse/spectral@24c022dde505b24970824dd50f51e719098cfeb3 call \
lint --ruleset file:path
func (m *myModule) example(documents []*File, ruleset *File) *Container {
return dag.
Spectral().
Lint(documents, ruleset)
}
@function
def example(documents: List[dagger.File], ruleset: dagger.File) -> dagger.Container:
return (
dag.spectral()
.lint(documents, ruleset)
)
@func()
example(documents: File[], ruleset: File): Container {
return dag
.spectral()
.lint(documents, ruleset)
}