Skip to content

chlorm/jsonnet-openapi-spec

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jsonnet-openapi-spec

A Jsonnet templating library for the OpenAPI spec.

ci status

WARNING: API is incomplete and subject to change.
local openapi = 'jsonnet-openapi-spec/openapi.libsonnet'

{
  'hello-world.json':
    openapi.new()
    .Info(
      openapi.info.new()
      .Title('Hello World')
      .Version('1')
      .Description('Hello World')
    )
    .Path(
      openapi.pathitem.new('/hello')
      .Get(
        openapi.operation.new('getHello')
        .Response(
          openapi.response.new(200)
          .Content(
            openapi.mediatype.new(openapi.mediatype.plaintext)
            .Schema(
              openapi.schema.new(openapi.schema.string)
              .Example('world')
            )
          )
        )
      )
    ),
}

About

A Jsonnet data templating library for the OpenAPI spec.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published