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

Fix internal server by tightening API spec #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions src/main/java/org/openapitools/api/StoreApiDelegateImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ void initOrders() {


@Override
public ResponseEntity<Void> deleteOrder(String orderId) {
Order order = orderRepository.findById(Long.valueOf(orderId))
public ResponseEntity<Void> deleteOrder(Long orderId) {
Order order = orderRepository.findById(orderId)
.orElseThrow(() -> new ResponseStatusException(HttpStatus.NOT_FOUND));
orderRepository.delete(order);
return ResponseEntity.ok().build();
Expand Down
8 changes: 7 additions & 1 deletion src/main/resources/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,8 @@ paths:
style: simple
explode: false
schema:
type: string
type: integer
format: int64
responses:
400:
description: Invalid ID supplied
Expand Down Expand Up @@ -598,6 +599,8 @@ components:
Order:
title: Pet Order
type: object
required:
- id
properties:
id:
type: integer
Expand Down Expand Up @@ -649,6 +652,9 @@ components:
User:
title: a User
type: object
required:
- id
- username
properties:
id:
type: integer
Expand Down