From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by sourceware.org (Postfix) with ESMTPS id 660C43858D33 for ; Tue, 28 Feb 2023 17:37:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 660C43858D33 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-x629.google.com with SMTP id i3so11241838plg.6 for ; Tue, 28 Feb 2023 09:37:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Pbe10G5KgPtcjWQt6yakIo9CdwW7OlKOMhvuANORV4U=; b=ac0ftyjuJH+2/Sd9JNGJ+TIc8I9w3qPHgLRZGMOkxli1NLz1qYnoQQNPXvjkqkaKxs pF56B33b90eUP3YeD2b7P9MwjXoZrrNAelvUbHxiPu9LL3DBvgSTFbwBUQmn9sb5Ho63 Xno5h7b4xRMLxajxt+Cg326617CSPXBpqZTZII8gG7HHN3smnXzuCM8+dVCJmDfYGgez l7zdC5Epk7gPwZ9Lwq1h72AlZWdqRh7N7bIvCRFGd7Yzj7EU1wHihi8mq9k06FwPbvW5 cJ5TqZpaq7I8XaT+W2Ht+cYl8wkL4zDs0BnVWSKmtS0IlZZsjQzCOMrDUikB+F4hWY0c 7hLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Pbe10G5KgPtcjWQt6yakIo9CdwW7OlKOMhvuANORV4U=; b=IRu2BqLsvy0oIGGmT/1wY3nwlDBm/H4TtELBzul1CXPwZHjudhNeNcwmlxR7tZSzVV V0ycC6uCXRjqiCKYBXToY9yEFFnePloZuoiJv8oTCHnmeb5fQxCoVFvvg0BYO89PDZfn SgHWvbKKBjFAlh29MNVjzDIwaBv8uNohkbNTbp43Ie5UNT8b+JOFl65OueSdipUWiKX3 mC/1gZPPmHfINjSnZtwu96Kr2vUhUWyRXkxL1d0YXigPhof1x3NnHAwH9T0ouciN3dM/ x65tX1FLSWJiaNOZ+XRsdevv0L3GwIKLdSb0cd9iztPlsTgQi9+s3QQlcRRH2SvGmaCz fmzQ== X-Gm-Message-State: AO0yUKXuLcxU0syWfEFwRqCQgV8gCF1hGg2NYSGJ5XTtCB1AkXqtDvYb PqJjcP1s7Qfxr6Xvi/XNjnM90WypmFu9+epQe/btiLLRBg8= X-Google-Smtp-Source: AK7set8c8SpcHN19zT03asTZb9btM2H3po4/+NqgTG7FKWa/iMKY4P3wKbX+Z3V3YtDMwXTLQIyGZnpRXJz+1FjPXNc= X-Received: by 2002:a17:902:e891:b0:199:482e:6f93 with SMTP id w17-20020a170902e89100b00199482e6f93mr7460253plg.2.1677605846193; Tue, 28 Feb 2023 09:37:26 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Arvydas Silanskas Date: Tue, 28 Feb 2023 19:37:14 +0200 Message-ID: Subject: Re: Having trouble using JAX-RS annotation in Kawa Scheme class To: Ross Merrifield Cc: kawa@sourceware.org Content-Type: multipart/alternative; boundary="000000000000891bb105f5c60c5b" X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --000000000000891bb105f5c60c5b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, try specifying the annotation field explicitly, ie `(@Produces value: (string[] "text/plain"))`. Test suite seems to have a test for this case https://gitlab.com/kashell/Kawa/-/blob/master/testsuite/annotations1.scm#L33 . If this still doesn't work, perhaps try building and running the head version from source. Arvydas 2023-02-28, an, 19:02 Ross Merrifield via Kawa ra=C5= =A1=C4=97: > Kawa mailing list, > > I am attempting to translate a simple JAX-RS example from Java to Kawa > Scheme. Overall, this has been successful, but I am having issues getting > the @Produces method annotation to work in one of my classes. > > Here is my Kawa class: > > (import (class jakarta.ws.rs GET > Path > Produces)) > > (define-simple-class MyResource () > (@Path "helloworld") ;;class annotations > > ((getIt) ;;method (no args) > (@GET) ;;method annotations > (@Produces (String "text/plain")) > ::java.lang.String ;;return type > "Got it!") ;;method body > ) > > And here is the Java class I am translating it from: > > import jakarta.ws.rs.GET; > import jakarta.ws.rs.Path; > import jakarta.ws.rs.Produces; > > @Path("helloworld") > public class MyResource { > @GET > @Produces("text/plain") > public String getHello() { > return "Hello World!"; > } > } > > The problem is, when I try to load the code, I get an error that "the type > java.lang.String is incompatible with the required type > java.lang.String[]". > But when I change my Annotation to (@Produces (String[] "text/plain")) I > get the error "annotation value must be constant". Checking the javadoc f= or > @prodcues does indicate the expected type of the value is String[]: > > > https://javadoc.io/doc/jakarta.ws.rs/jakarta.ws.rs-api/latest/jakarta.ws.= rs/jakarta/ws/rs/Produces.html > > Is there another syntax I should be trying here? As it stands now, it see= ms > to me like it's impossible to use this annotation from Kawa. > > Thanks, > > Ross > --000000000000891bb105f5c60c5b--