Skip to content

improve endpoint support #1577

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

Merged
merged 6 commits into from
Feb 20, 2024
Merged

improve endpoint support #1577

merged 6 commits into from
Feb 20, 2024

Conversation

drbh
Copy link
Collaborator

@drbh drbh commented Feb 19, 2024

small PR to add a new interface endpoint behind a feature

@Narsil
Copy link
Collaborator

Narsil commented Feb 19, 2024

Have you checked if the openapi is correctly created ? I think you forgot to add the structs to the utopia thing to generate them properly, no ?

@drbh drbh requested a review from Narsil February 19, 2024 17:01
@Narsil Narsil merged commit df23062 into main Feb 20, 2024
@Narsil Narsil deleted the support-vertex-endpoint branch February 20, 2024 13:04
@OlivierDehaene
Copy link
Contributor

This PR does not compile.

Comment on lines +1039 to +1059
// Define VertextApiDoc conditionally only if the "google" feature is enabled
#[cfg(feature = "google")]
#[derive(OpenApi)]
#[openapi(
paths(vertex_compatibility),
components(schemas(VertexInstance, VertexRequest, VertexResponse))
)]
struct VertextApiDoc;

let doc = {
// avoid `mut` if possible
#[cfg(feature = "google")]
{
// limiting mutability to the smallest scope necessary
let mut doc = doc;
doc.merge(VertextApiDoc::openapi());
doc
}
#[cfg(not(feature = "google"))]
ApiDoc::openapi()
};
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be:

// Define VertextApiDoc conditionally only if the "google" feature is enabled
    let doc = {
        // avoid `mut` if possible
        #[cfg(feature = "google")]
        {
            use crate::VertexInstance;

            #[derive(OpenApi)]
            #[openapi(
            paths(vertex_compatibility),
            components(schemas(VertexInstance, VertexRequest, VertexResponse))
            )]
            struct VertextApiDoc;

            // limiting mutability to the smallest scope necessary
            let mut doc = ApiDoc::openapi();
            doc.merge(VertextApiDoc::openapi());
            doc
        }
        #[cfg(not(feature = "google"))]
        ApiDoc::openapi()
    };

kdamaszk pushed a commit to kdamaszk/tgi-gaudi that referenced this pull request Apr 29, 2024
small PR to add a new interface endpoint behind a feature
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