Nswag: Generate client

Created on 5 Apr 2018  路  5Comments  路  Source: RicoSuter/NSwag

Hello,

Is it possible to generate a client c # without ui swagger? My api it's private, I do not want a ui swagger.

question

All 5 comments

You can generate from DLL with no ui/middleware at all...

@RSuter I have problems, NSwagStudio generate this:

public async System.Threading.Tasks.Task<FileResponse> RegistroAsync(Usuario usuario, System.Threading.CancellationToken cancellationToken)

FileResponse?????? i don't understand sorry.

My controller api:

        [HttpPost]
        public async Task<IActionResult> Registro([FromBody] Usuario usuario)
        {
            string result = await _usuarioRepository.RegistrarUsuarioAsync(usuario);
            return Ok(result);
        }

FileResponse is a generated wrapper to access a file response (it contains the received headers, a response stream, etc.)

@RSuter thanks a lot! fixed it

Was this page helpful?
0 / 5 - 0 ratings