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

Change the return type of CatalogObjectController methods #99

Merged
merged 1 commit into from
Jan 10, 2018

Conversation

MaelAudren
Copy link
Contributor

@MaelAudren MaelAudren commented Jan 5, 2018

Change the return type of CatalogObjectController method in order to fix issues with the swagger model. It fix issues that prevent the generation of a usable catalog client.
It solves the swagger model issue "Not a valid ...File definition"

@MaelAudren MaelAudren force-pushed the swagger-model branch 3 times, most recently from 262afe0 to 522779b Compare January 5, 2018 14:56
@@ -242,7 +240,7 @@ public CatalogObjectMetadataList create(
} catch (IOException ioe) {
throw new RuntimeException(ioe);
}
return ResponseEntity.status(status).build();
return new ResponseEntity<>(status);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer to use the builder .... ResponseEntity.status(status).build();

Copy link
Contributor Author

@MaelAudren MaelAudren Jan 9, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ResponseEntity.status(status).build(); return a Response which doesn't compile due to the return Response<List>

@@ -302,7 +300,7 @@ public CatalogObjectMetadataList create(
commitTimeRaw);
return ResponseEntity.ok(catalogObjectMetadata);
} catch (RevisionNotFoundException e) {
return ResponseEntity.notFound().build();
return new ResponseEntity(HttpStatus.NOT_FOUND);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better with the builder no?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as upper response

Copy link
Contributor

@pedrovelho pedrovelho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works locally, pass unit tests and integration tests.

@MaelAudren MaelAudren merged commit 6acdb81 into ow2-proactive:master Jan 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants