Skip to content
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

🎨 Improve operationIds for SDK generation #524

Merged
merged 2 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
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
96 changes: 48 additions & 48 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,47 +164,47 @@ services:
retries: 5
start_period: 10s

webapp-nextjs:
build:
dockerfile: ./apps/client-ts/Dockerfile.dev
context: ./
args:
VITE_BACKEND_DOMAIN: ${NEXT_PUBLIC_BACKEND_DOMAIN}
VITE_FRONTEND_DOMAIN: ${NEXT_PUBLIC_MAGIC_LINK_DOMAIN}
environment:
NEXT_PUBLIC_DISTRIBUTION: ${DISTRIBUTION}
NEXT_PUBLIC_BACKEND_DOMAIN: ${NEXT_PUBLIC_BACKEND_DOMAIN}
NEXT_PUBLIC_MAGIC_LINK_DOMAIN: ${NEXT_PUBLIC_MAGIC_LINK_DOMAIN}
NEXT_PUBLIC_WEBAPP_DOMAIN: ${NEXT_PUBLIC_WEBAPP_DOMAIN}
restart: unless-stopped
ports:
- 80:8090
depends_on:
api:
condition: service_healthy
volumes:
- .:/app
networks:
- backend
- frontend
# webapp-nextjs:
# build:
# dockerfile: ./apps/client-ts/Dockerfile.dev
# context: ./
# args:
# VITE_BACKEND_DOMAIN: ${NEXT_PUBLIC_BACKEND_DOMAIN}
# VITE_FRONTEND_DOMAIN: ${NEXT_PUBLIC_MAGIC_LINK_DOMAIN}
# environment:
# NEXT_PUBLIC_DISTRIBUTION: ${DISTRIBUTION}
# NEXT_PUBLIC_BACKEND_DOMAIN: ${NEXT_PUBLIC_BACKEND_DOMAIN}
# NEXT_PUBLIC_MAGIC_LINK_DOMAIN: ${NEXT_PUBLIC_MAGIC_LINK_DOMAIN}
# NEXT_PUBLIC_WEBAPP_DOMAIN: ${NEXT_PUBLIC_WEBAPP_DOMAIN}
# restart: unless-stopped
# ports:
# - 80:8090
# depends_on:
# api:
# condition: service_healthy
# volumes:
# - .:/app
# networks:
# - backend
# - frontend

magic-link-frontend:
build:
dockerfile: ./apps/magic-link/Dockerfile.dev
context: ./
args:
VITE_BACKEND_DOMAIN: ${NEXT_PUBLIC_BACKEND_DOMAIN}
restart: always
ports:
- 81:5173
depends_on:
api:
condition: service_healthy
networks:
- backend
- frontend
volumes:
- .:/app
# magic-link-frontend:
# build:
# dockerfile: ./apps/magic-link/Dockerfile.dev
# context: ./
# args:
# VITE_BACKEND_DOMAIN: ${NEXT_PUBLIC_BACKEND_DOMAIN}
# restart: always
# ports:
# - 81:5173
# depends_on:
# api:
# condition: service_healthy
# networks:
# - backend
# - frontend
# volumes:
# - .:/app

# ngrok:
# image: ngrok/ngrok:latest
Expand All @@ -223,14 +223,14 @@ services:
# condition: service_healthy
# network_mode: "host"

docs:
build:
dockerfile: ./Dockerfile.dev
context: ./docs/
ports:
- 911:3000
volumes:
- ./docs/:/app
# docs:
# build:
# dockerfile: ./Dockerfile.dev
# context: ./docs/
# ports:
# - 911:3000
# volumes:
# - ./docs/:/app

networks:
frontend:
Expand Down
1 change: 0 additions & 1 deletion packages/api/src/app.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export class AppController {
this.logger.setContext(AppController.name);
}

@ApiOperation({ operationId: 'getHello' })
@Get()
hello(): string {
return this.appService.getHello();
Expand Down
4 changes: 2 additions & 2 deletions packages/api/src/crm/contact/contact.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ export class ContactController {
}

@ApiOperation({
operationId: 'getCrmContacts',
summary: 'List a batch of CRM Contacts',
operationId: 'listCrmContacts',
summary: 'List CRM Contacts',
})
@ApiHeader({
name: 'x-connection-token',
Expand Down
4 changes: 3 additions & 1 deletion packages/api/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import * as fs from 'fs';
import * as cookieParser from 'cookie-parser';
import { useContainer } from 'class-validator';
import * as cors from 'cors';
import * as yaml from 'js-yaml';


async function bootstrap() {
const app = await NestFactory.create(AppModule);
Expand All @@ -25,7 +27,7 @@ async function bootstrap() {
useContainer(app.select(AppModule), { fallbackOnErrors: true });

SwaggerModule.setup('docs', app, document);
//fs.writeFileSync('./swagger/swagger-spec.yaml', yaml.dump(document));
fs.writeFileSync('./swagger/swagger-spec.yaml', yaml.dump(document));
fs.writeFileSync(
'./swagger/swagger-spec.json',
JSON.stringify(document, null, 2),
Expand Down
7 changes: 7 additions & 0 deletions packages/api/swagger/extended_specs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
x-speakeasy-name-override:
- operationId: ^get.*
methodNameOverride: retrieve
- operationId: ^list.*
methodNameOverride: list
- operationId: ^new.*
methodNameOverride: create
7 changes: 3 additions & 4 deletions packages/api/swagger/swagger-spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
"paths": {
"/": {
"get": {
"operationId": "getHello",
"summary": "",
"operationId": "AppController_hello",
"parameters": [],
"responses": {
"200": {
Expand Down Expand Up @@ -1658,8 +1657,8 @@
},
"/crm/contacts": {
"get": {
"operationId": "getCrmContacts",
"summary": "List a batch of CRM Contacts",
"operationId": "listCrmContacts",
"summary": "List CRM Contacts",
"parameters": [
{
"name": "x-connection-token",
Expand Down
Loading
Loading