-
Notifications
You must be signed in to change notification settings - Fork 18
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
[DevOps] .spectral.yaml 수정 - 404, 400 정의 #268 #305
Conversation
같이 도전해보아욥 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@o-ii
src/AzureOpenAIProxy.ApiApp/Endpoints/WeatherForecastEndpoint.cs
GET /weatherforecast 부분에서 404 린팅을,
src/AzureOpenAIProxy.ApiApp/Endpoints/AdminEventEndpoints.cs
POST /admin/events 부분에서 400 린팅을 테스트해볼 수 있겠네요
코드단에서 400, 404 부분을 추가, 삭제하며 테스트해보고
결과를 PR 본문에 첨부해주실래욥?
404 린팅은 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/AzureOpenAIProxy.ApiApp/Endpoints/WeatherForecastEndpoint.cs
GET /weatherforecast 부분에서 404 린팅을,
src/AzureOpenAIProxy.ApiApp/Endpoints/AdminEventEndpoints.cs
POST /admin/events 부분에서 400 린팅을 테스트해볼 수 있겠네요
코드단에서 400, 404 부분을 추가, 삭제하며 테스트해보고 결과를 PR 본문에 첨부해주실래욥?404 린팅은
POST
/openai/deployments/{deploymentName}/chat/completions 부분에서, (path에 path variable 포함) 400 린팅은POST
/admin/events 부분에서 각각 테스트한 결과를 PR 본문에 추가했습니다.
- 테스트 케이스
테스트 케이스 | 설명 | 응답 정의 |
---|---|---|
Path 변수에 404 응답 없음 | Path 변수가 있지만 404 응답이 정의되지 않음 | 404 없음 |
Path 변수에 404 응답 있음 | Path 변수가 있고 404 응답이 정의됨 | 404 있음 |
POST 요청에 400 응답 없음 | POST 요청이지만 400 응답이 정의되지 않음 | 400 없음 |
POST 요청에 400 응답 있음 | POST 요청이며 400 응답이 정의됨 | 400 있음 |
PUT 요청에 400 응답 없음 | PUT 요청이지만 400 응답이 정의되지 않음 | 400 없음 |
PUT 요청에 400 응답 있음 | PUT 요청이며 400 응답이 정의됨 | 400 있음 |
PATCH 요청에 400 응답 없음 | PATCH 요청이지만 400 응답이 정의되지 않음 | 400 없음 |
PATCH 요청에 400 응답 있음 | PATCH 요청이며 400 응답이 정의됨 | 400 있음 |
각각의 테스트 케이스에 대해 routerbuilder를 작성해보았고 (feat. copilot)
작성해주신 규칙이 모두 잘 적용되는 것을 확인했습니다 !
/Users/bachtaeyeong/10_SrcHub/azure-openai-sdk-proxy/swagger.json
381:21 error path-variables-require-404 (o-ii) Path variables must include a 404 response paths./AddWeatherForecastPatchNo400/{id}.patch.responses
381:21 error post-put-patch-require-400 (o-ii) POST, PUT, PATCH methods must include a 400 response paths./AddWeatherForecastPatchNo400/{id}.patch.responses
437:21 error path-variables-require-404 (o-ii) Path variables must include a 404 response paths./AddWeatherForecastPatchWith400/{id}.patch.responses
485:21 error post-put-patch-require-400 (o-ii) POST, PUT, PATCH methods must include a 400 response paths./AddWeatherForecastPostNo400.post.responses
609:21 error path-variables-require-404 (o-ii) Path variables must include a 404 response paths./AddWeatherForecastPutNo400/{id}.put.responses
609:21 error post-put-patch-require-400 (o-ii) POST, PUT, PATCH methods must include a 400 response paths./AddWeatherForecastPutNo400/{id}.put.responses
665:21 error path-variables-require-404 (o-ii) Path variables must include a 404 response paths./AddWeatherForecastPutWith400/{id}.put.responses
665:21 error post-put-patch-require-400 (o-ii) POST, PUT, PATCH methods must include a 400 response paths./AddWeatherForecastPutWith400/{id}.put.responses
Issue
#268
Description
.spectral.yaml
파일에 404, 400 상태 코드에 대한 린팅 규칙을 추가했습니다.Summary of Changes
1. 404 린팅 조건
404
응답 코드가 있어야 함린팅 테스트 결과
POST
/openai/deployments/{deploymentName}/chat/completions2. 400 린팅 조건
POST
,PUT
,PATCH
메서드를 사용하는 경우,400
응답코드가 있어야 함린팅 테스트 결과
POST
/admin/eventsHow to Test (from #229)
Reference