From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by sourceware.org (Postfix) with ESMTPS id 66B803858D3C for ; Tue, 28 Feb 2023 17:02:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 66B803858D3C 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-wr1-x430.google.com with SMTP id v16so7695482wrn.0 for ; Tue, 28 Feb 2023 09:02:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1677603724; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=6i5p04SBIn8U7LfP4exULaC0bFlfYrmFowCn4qV+jco=; b=adZWC0S8rs8gtMm53cDEJYrTuLQR89jka5+c/8vHaS1uM+p2RRIwCiz4nW3wkT1U81 HF103mRIoY08bTJ7UKRPBEprcONBO+TJierMf6eFn5mnKA3R8QWOCK7pwoYTRAwMXOCW +y+vIJcGMxTtHpl6+kbL3LVuAGRVbwxXi8wHocpvl1wrh6VOZ6AN3BZhHMRKERjmlfDs RRezXUnSMDfNtOQXuC9Yf8gjmdsqvQhuRZ207ICmbeShyqEEFqSxYmMQRE6pBsPfHrGO p+98i0DnhxS0fAHZzEBCNlo93IJVW2uE+tR5+NK8OGmw5jE7o11zewB00szilNQse7HX ha5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677603724; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=6i5p04SBIn8U7LfP4exULaC0bFlfYrmFowCn4qV+jco=; b=VXXPh29FnV/dZ98cAoo7XhuOUdvlxd6ALTWGumRTyL0KEGaqWny+Q0yvHh5bzn7p6D hEObhIzO5frrAaMGFSYFpsvItRtPrVsK3twuKqC3a/fInKij7VFMnynSOhd9LJskLAio u+53rdYVTFkir5WCzdshyvcs7mJQqepRH89exKR4U+ZFPPHf9FdKqy72Eo5RCs6lEbQn Gv2f8V3W2fcz1dlzXTdsbA2zLZhVxjwQjcQthj0M1eV1QF+NryagBtbW73bzfulyd1P8 pUbi1TXO8fFTcWmSJ1mNZaGEvDL9i4S1wKVuEgXPPVkZyL+VVEZ6B64PieeyBgrrizv9 Zg1w== X-Gm-Message-State: AO0yUKWN2oTSJN/2Sau4FCj8Tb+GNQqSNjjmN1ocDMrn7+cTAxpdsryK X9h+U3zF5UQIqgIINwFUp5QQHAt5PYQVIU+bi+Y3VgMQ4MzbqQ== X-Google-Smtp-Source: AK7set+Px2lEMWPtJ1oNr9S3ZErA64LRrlSP1HvUJc+Fl54E3ZL2nvGsBEvTOB8+G1LOeej0RjtFiBwSD7ePUHU37XQ= X-Received: by 2002:a5d:6943:0:b0:2c7:17a0:127c with SMTP id r3-20020a5d6943000000b002c717a0127cmr620697wrw.8.1677603723644; Tue, 28 Feb 2023 09:02:03 -0800 (PST) MIME-Version: 1.0 From: Ross Merrifield Date: Tue, 28 Feb 2023 09:01:52 -0800 Message-ID: Subject: Having trouble using JAX-RS annotation in Kawa Scheme class To: kawa@sourceware.org Content-Type: multipart/alternative; boundary="00000000000005916b05f5c58ec5" X-Spam-Status: No, score=0.4 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: --00000000000005916b05f5c58ec5 Content-Type: text/plain; charset="UTF-8" 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 for @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 seems to me like it's impossible to use this annotation from Kawa. Thanks, Ross --00000000000005916b05f5c58ec5--