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

How to integrate jsonapidotnetcore with swagger for its specific swagger UI with that include ,fields and other fields on swagger UI #1156

Closed
GOSAVINIRAJ121 opened this issue May 24, 2022 · 10 comments

Comments

@GOSAVINIRAJ121
Copy link

Please read our Contributing Guides before suggesting an idea.

Is your feature request related to a problem? Please describe.
How to integrate jsonapidotnetcore with swagger for its specific swagger UI with that include ,fields and other fields on swagger UI

Describe the solution you'd like
I want to integrate jsonapidotnetcore with swagger for its specific swagger UI with that include ,fields and other fields on swagger UI.
It should show its request model in json api format. And It should have include, fields, access_token like fields on swagger UI

@GOSAVINIRAJ121
Copy link
Author

Hi, Can any one help me on this?

@bkoelman
Copy link
Member

See #1046. You can try the openapi branch or grab its NuGet from AppVeyor, but the work is largely incomplete. There is no fully working OpenAPI implementation for JADNC at this point.

@GOSAVINIRAJ121
Copy link
Author

GOSAVINIRAJ121 commented May 24, 2022

@bkoelman can you please provide me branch link or complete NuGet package name? And also please provide any jsonapi project example where that NuGet package is used?

@bkoelman
Copy link
Member

See https://github.com/json-api-dotnet/JsonApiDotNetCore#trying-out-the-latest-build and pick one with OpenAPI suffix.

@GOSAVINIRAJ121
Copy link
Author

@bkoelman I have installed JsonApiDotNetCore.OpenApi. Do you have any jsonapi project example where that new Open API features are used?

@bkoelman
Copy link
Member

There's several usages in that branch from tests and examples. See also the documentation below the docs folder.

@GOSAVINIRAJ121
Copy link
Author

@bkoelman If you know can you tell me till when can we expect that openAPI fully functional? And can you suggest any alternative till that time?

@GOSAVINIRAJ121
Copy link
Author

@bkoelman I am using PatchAsync method of JADNC but in my request I am don't want to send Updated_At Attribute and I want to update that field before sending that request to base.PatchAsync. But its not updating Updated_At in DB. Following is my code

    [HttpPatch("{customer_id}")]
    public async Task<IActionResult> PatchAsync(Guid customer_id, customer resource, CancellationToken cancellationToken)
    {
        try
        {              
            resource.updated_at = DateTime.UtcNow; //Its not getting updated in DB through this PatchAsync method
            return await base.PatchAsync(customer_id, resource, cancellationToken);              
        }
        catch (Exception ex)
        {
            ErrorObject error = new ErrorObject(HttpStatusCode.InternalServerError);
            error.StatusCode = HttpStatusCode.InternalServerError;
            error.Title = ex.Message;
            error.Detail = "Unhandled error : " + (ex.InnerException != null ? (ex.InnerException.InnerException != null ? ex.InnerException.InnerException.Message : ex.Message) : ex.Message);
            return Error(error);
        }
    }

Can you please help me in this?

@GOSAVINIRAJ121
Copy link
Author

GOSAVINIRAJ121 commented May 26, 2022

@nwise Hi, Can any one help me on this?

@bkoelman
Copy link
Member

Adding OpenAPI support is an immense amount of work, and I wouldn't expect that to be available anytime soon. Alternatively, you can use one of the client libraries at https://jsonapi.org/implementations/.

Regarding your other question: take a closer look at our documentation and the various examples in de codebase. I suspect what you're looking for are resource definitions, but it's hard to say with such a vague description.

And this question is unrelated to OpenAPI, so should not be asked in the same issue.

I'm closing this issue. We can help with all kinds of questions, but remember we expect you to try to figure it out yourself first, read the docs, search in existing issues, ask for help from a co-worker, etc. Then if you can't solve it, make sure to provide a crystal-clear description of what you're trying to accomplish and why, what you tried (repro steps) etc. See also the contributing guidelines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants