Skip to content

Commit bde82b4

Browse files
committed
add content-type
1 parent 8a40836 commit bde82b4

22 files changed

+40
-40
lines changed

typespec/http-api/services/authService.tsp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ namespace AppService;
1010
@route("/login")
1111
interface AuthService {
1212
@post
13-
op create(...AuthData): AuthToken;
13+
op create(@header contentType: "application/json" | "application/x-www-form-urlencoded", ...AuthData): AuthToken;
1414
}

typespec/http-api/services/commentsService.tsp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ interface CommentService {
2727

2828
@useAuth(BearerAuth)
2929
@post
30-
op create(...NewCommentDto): Comment;
30+
op create(@header contentType: "application/json" | "application/x-www-form-urlencoded", ...NewCommentDto): Comment;
3131

3232
@useAuth(BearerAuth)
3333
@patch
34-
op update(@path id: string, ...EditCommentDto): Comment;
34+
op update(@header contentType: "application/json" | "application/x-www-form-urlencoded", @path id: string, ...EditCommentDto): Comment;
3535

3636
@useAuth(BearerAuth)
3737
@delete

typespec/http-api/services/coursesService.tsp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ interface CourseService {
2626
): Course;
2727

2828
@post
29-
op create(...NewCourseDto): Course;
29+
op create(@header contentType: "application/json" | "application/x-www-form-urlencoded", ...NewCourseDto): Course;
3030

3131
@patch
32-
op update(@path id: string, ...EditCourseDto): Course;
32+
op update(@header contentType: "application/json" | "application/x-www-form-urlencoded", @path id: string, ...EditCourseDto): Course;
3333

3434
@delete
3535
op delete(@path id: string): void;

typespec/http-api/services/postsService.tsp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ interface PostService {
2626

2727
@useAuth(BearerAuth)
2828
@post
29-
op create(...NewPostDto): Post;
29+
op create(@header contentType: "application/json" | "application/x-www-form-urlencoded", ...NewPostDto): Post;
3030

3131
@useAuth(BearerAuth)
3232
@patch
33-
op update(@path id: string, ...EditPostDto): Post;
33+
op update(@header contentType: "application/json" | "application/x-www-form-urlencoded", @path id: string, ...EditPostDto): Post;
3434

3535
@useAuth(BearerAuth)
3636
@delete

typespec/http-api/services/tasksService.tsp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ interface TaskService {
2525
): Task;
2626

2727
@post
28-
op create(...NewTaskDto): Task;
28+
op create(@header contentType: "application/json" | "application/x-www-form-urlencoded", ...NewTaskDto): Task;
2929

3030
@patch
31-
op update(@path id: string, ...EditTaskDto): Task;
31+
op update(@header contentType: "application/json" | "application/x-www-form-urlencoded", @path id: string, ...EditTaskDto): Task;
3232

3333
@delete
3434
op delete(@path id: string): void;

typespec/http-api/services/usersService.tsp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ interface UserService {
2828
): User;
2929

3030
@post
31-
op create(...NewUserDto): User;
31+
op create(@header contentType: "application/json" | "application/x-www-form-urlencoded", ...NewUserDto): User;
3232

3333
@useAuth(BearerAuth)
3434
@patch
35-
op update(@path id: string, ...EditUserDto): User;
35+
op update(@header contentType: "application/json" | "application/x-www-form-urlencoded", @path id: string, ...EditUserDto): User;
3636

3737
@useAuth(BearerAuth)
3838
@delete

typespec/http-protocol/services/authService.tsp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ namespace AppService;
1010
@route("/login")
1111
interface AuthService {
1212
@post
13-
op create(...AuthData): AuthToken;
13+
op create(@header contentType: "application/json" | "application/x-www-form-urlencoded", ...AuthData): AuthToken;
1414
}

typespec/http-protocol/services/commentsService.tsp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ interface CommentService {
2727

2828
@useAuth(BearerAuth)
2929
@post
30-
op create(...NewCommentDto): Comment;
30+
op create(@header contentType: "application/json" | "application/x-www-form-urlencoded", ...NewCommentDto): Comment;
3131

3232
@useAuth(BearerAuth)
3333
@patch
34-
op update(@path id: string, ...EditCommentDto): Comment;
34+
op update(@header contentType: "application/json" | "application/x-www-form-urlencoded", @path id: string, ...EditCommentDto): Comment;
3535

3636
@useAuth(BearerAuth)
3737
@delete

typespec/http-protocol/services/coursesService.tsp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ interface CourseService {
2626
): Course;
2727

2828
@post
29-
op create(...NewCourseDto): Course;
29+
op create(@header contentType: "application/json" | "application/x-www-form-urlencoded", ...NewCourseDto): Course;
3030

3131
@patch
32-
op update(@path id: string, ...EditCourseDto): Course;
32+
op update(@header contentType: "application/json" | "application/x-www-form-urlencoded", @path id: string, ...EditCourseDto): Course;
3333

3434
@delete
3535
op delete(@path id: string): void;

typespec/http-protocol/services/postsService.tsp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ interface PostService {
2626

2727
@useAuth(BearerAuth)
2828
@post
29-
op create(...NewPostDto): Post;
29+
op create(@header contentType: "application/json" | "application/x-www-form-urlencoded", ...NewPostDto): Post;
3030

3131
@useAuth(BearerAuth)
3232
@patch
33-
op update(@path id: string, ...EditPostDto): Post;
33+
op update(@header contentType: "application/json" | "application/x-www-form-urlencoded", @path id: string, ...EditPostDto): Post;
3434

3535
@useAuth(BearerAuth)
3636
@delete

0 commit comments

Comments
 (0)