Skip to content

Question: proper flow with resolve and lint #235

@dlouzan

Description

@dlouzan

I'd like to know which flow do you guys use for resolve + lint.

My use case is I'd like to follow @philsturgeon suggestion in his blog and set an api-first workflow for our team, writing OpenAPI 3 with JSON Schema data models.

As part of this, I'd like to configure my CI to validate all schemas, and lint all OAS files.

Currently I have something like this:

# Verify JSON Schemas
$ ajv compile -s "schemas/*.json" -r "schemas/*.json" --verbose

# Convert JSON Schema models to OpenAPI-flavor and lint
$ speccy lint <(speccy resolve openapi.yaml -j)

The issue with this flow is that it seems speccy cannot work with stdin, so I either have to work with temporary files, or do process substitution in bash as above, but process substitution has known issues with error handling.

Am I missing anything? how do you guys do this?

What I'm thinking right now is providing a PR that enables stdin support for speccy, so that I can properly pipe the commands and have proper error handling, and maybe add some extra info in the readme:

$ speccy resolve openapi.yaml -j | speccy lint

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions