Skip to content

Commit 00a06d1

Browse files
author
Jamie Tanna
committed
docs(tests): add an example of using in: cookie
Ahead of being able to fix #924, we should have an example that shows the before-and-after usage of what this looks like.
1 parent b22278d commit 00a06d1

4 files changed

Lines changed: 222 additions & 0 deletions

File tree

‎internal/test/cookies/config.yaml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# yaml-language-server: $schema=../../../configuration-schema.json
2+
package: cookies
3+
generate:
4+
chi-server: true
5+
models: true
6+
output: cookies.gen.go

‎internal/test/cookies/cookies.gen.go‎

Lines changed: 195 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎internal/test/cookies/generate.go‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
package cookies
2+
3+
//go:generate go run github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen --config=config.yaml spec.yaml

‎internal/test/cookies/spec.yaml‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
openapi: "3.0.1"
2+
info:
3+
version: 1.0.0
4+
title: Cookie parameters
5+
paths:
6+
/cookies:
7+
get:
8+
operationId: cookieParams
9+
parameters:
10+
- name: authId
11+
description: Cookie parameter
12+
in: cookie
13+
required: false
14+
schema:
15+
type: string
16+
responses:
17+
204:
18+
description: no content

0 commit comments

Comments
 (0)