Skip to content

Fix and add examples #225

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 10, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 61 additions & 8 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ import { Code } from 'astro:components';
<Code themes={{'light': 'github-light', 'dark': 'github-dark'}} lang="yaml" code={`document:
dsl: '1.0.0-alpha5'
namespace: examples
name: call-http-shorthand-endpoint
name: call-http
version: '1.0.0'
do:
- getPet:
Expand All @@ -79,13 +79,13 @@ do:
method: get
endpoint: https://petstore.swagger.io/v2/pet/{petId}`} />
</div>
<input type="radio" name="code_tabs" role="tab" class="tab" aria-label="Async API" />
<input type="radio" name="code_tabs" role="tab" class="tab" aria-label="AsyncAPI" />
<div role="tabpanel" class="tab-content bg-base-100 border-base-300 rounded-box p-6">
<h3 class="text-xl font-bold mb-4">Async API Example</h3>
<h3 class="text-xl font-bold mb-4">AsyncAPI Example</h3>
<Code themes={{'light': 'github-light', 'dark': 'github-dark'}} lang="yaml" code={`document:
dsl: '1.0.0-alpha5'
namespace: examples
name: bearer-auth
name: call-asyncapi
version: '1.0.0'
do:
- findPet:
Expand All @@ -95,14 +95,67 @@ do:
uri: https://fake.com/docs/asyncapi.json
operationRef: findPetsByStatus
server: staging
message: getPetByStatusQuery
binding: http
payload:
petId: $\{ .pet.id }
message:
payload:
petId: $\{ .pet.id }
authentication:
bearer:
token: $\{ .token }`} />
</div>
<input type="radio" name="code_tabs" role="tab" class="tab" aria-label="OpenAPI" />
<div role="tabpanel" class="tab-content bg-base-100 border-base-300 rounded-box p-6">
<h3 class="text-xl font-bold mb-4">OpenAPI Example</h3>
<Code themes={{'light': 'github-light', 'dark': 'github-dark'}} lang="yaml" code={`document:
dsl: '1.0.0-alpha5'
namespace: examples
name: call-openapi
version: '1.0.0'
do:
- findPet:
call: openapi
with:
document:
endpoint: https://petstore.swagger.io/v2/swagger.json
operationId: findPetsByStatus
parameters:
status: available`} />
</div>
<input type="radio" name="code_tabs" role="tab" class="tab" aria-label="gRPC" />
<div role="tabpanel" class="tab-content bg-base-100 border-base-300 rounded-box p-6">
<h3 class="text-xl font-bold mb-4">gRPC Example</h3>
<Code themes={{'light': 'github-light', 'dark': 'github-dark'}} lang="yaml" code={`document:
dsl: '1.0.0-alpha5'
namespace: examples
name: call-grpc
version: '1.0.0'
do:
- greet:
call: grpc
with:
proto:
endpoint: file://app/greet.proto
service:
name: GreeterApi.Greeter
host: localhost
port: 5011
method: SayHello
arguments:
name: '$\{ .user.preferredDisplayName }'`} />
</div>
<input type="radio" name="code_tabs" role="tab" class="tab" aria-label="Container" />
<div role="tabpanel" class="tab-content bg-base-100 border-base-300 rounded-box p-6">
<h3 class="text-xl font-bold mb-4">Container Example</h3>
<Code themes={{'light': 'github-light', 'dark': 'github-dark'}} lang="yaml" code={`document:
dsl: '1.0.0-alpha5'
namespace: examples
name: run-container
version: '1.0.0'
do:
- runContainer:
run:
container:
image: fake-image`} />
</div>
</div>
</Section>

Expand Down