-
Notifications
You must be signed in to change notification settings - Fork 17
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
Can't Produce Observable Service #28
Comments
Hey Tomasz |
Hello,
I'm having a bit of trouble getting started. I have followed the example trying to produce and observable based service but the output is not as expected. I am using the example code provided on the HOWTO to configure an "Angular4ImplementationGenerator"
The output is:
public createRegistration(arg1: RegistrationRequest): RegistrationRequest { const headers = new HttpHeaders().set('Content-type', 'application/json'); return this.httpService.post('/sec/registrations/create', JSON.stringify(arg1) , {headers, responseType: 'text'}).pipe(map(res => JSON.parse(res))); }
instead of the desired:
public createRegistration(arg1: RegistrationRequest): Observable<RegistrationRequest> { const headers = new HttpHeaders().set('Content-type', 'application/json'); return this.httpService.post<RegistrationRequest>('/sec/registrations/create', arg1 , {headers, responseType: 'text'}); }
My MVC Controller definition is:
@PostMapping(path = PATH_CREATE_REGISTRATION, produces = "application/json") @ResponseBody @ResponseStatus(HttpStatus.CREATED) public RegistrationRequest createRegistration(HttpServletRequest httpRequest, @RequestBody RegistrationRequest registration) throws Exception {
What am I doing wrong?
The text was updated successfully, but these errors were encountered: