From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by sourceware.org (Postfix) with ESMTPS id A4B323858D33 for ; Tue, 28 Feb 2023 19:03:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A4B323858D33 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-x42a.google.com with SMTP id h14so10866162wru.4 for ; Tue, 28 Feb 2023 11:03:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1677610999; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=wjNWfYot12o6bC7qBFhE1PLy0Df1CyaSMoQ3l2eh5XY=; b=jl4pkR7sbmPPp2mno9+AuPQQT/3gwuA4RLERgt4tJkyGPntnwuYLBYu2gykNnDwAEf G8W0+ZOdL4bN8BE7pGKYAzIdGR50ljTDN/mz9axUx9ouWI9jE4XJWW50rrcQoDNpSmeK 4dEHTIGyAd8LkQi+l0yHKOSWg4TE37BTwvuGlr7JaMvkhek8zq5eGe/LlLQtZu2m9rwO ejm1LsBcfbml06WxwHem+hOfNuEvxdR2awUyMGtNkPqMUHTL9Ddty0fC6k/GOu3AvCkQ 2vI3fiW3wXgG1uzX9KT0jfak+c5XbGW6F8/WvbxM0pEb+N/3/SoPK72a/QLkLygi/gBF 3P8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677610999; 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=wjNWfYot12o6bC7qBFhE1PLy0Df1CyaSMoQ3l2eh5XY=; b=2FFeqoZRMcn4SFxccPSrv4amndI/YxgimtsMqhS/+Zt6phuUoTT/OBOwLwR3Vk6dHe Dl5NoVd3QzzzX9XEhd13RGztlY38+xHPPq+bBhKmyR1rU2QrLeXt5jy5ftu4odEf4n6a QJ8xr7ATwgQ688LAk0nXna2hi8+os7WBkwfdnMhY7sRjcsm1WgPZIWkCy0Fa07icjXzG GvjuxZv2eo5QVCYsFsT27Mafj6TVZtl+UcIZ63jhw7mGvrKBPf0p9ORTFOCpJ2wI1SNH wHQLPllDCsKdI6T0+YOqdOmz0FsxThLuGKUFyYgE85Z4Q7Bq0dqL+onPFx1l3PkMLLAX fiNQ== X-Gm-Message-State: AO0yUKWY/5GRaNzUs3O3atZYAr+PI64LLUg8hsbm4NIiT7HutVrN6tL1 N8O5ACKzPBR6Wl1pWeMjhKarWukx2roTBkVTA0jy8nPMhrU= X-Google-Smtp-Source: AK7set/uDzIkLcBDuxO6JeuFlZqWPa3c9RIfA/gF8HqiJM0u8SYyMfZmamzZc0NcO/VBFSqwLlENSVFlLf9Dly1P66g= X-Received: by 2002:adf:e848:0:b0:2c9:96b6:1a4a with SMTP id d8-20020adfe848000000b002c996b61a4amr796352wrn.8.1677610999201; Tue, 28 Feb 2023 11:03:19 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Ross Merrifield Date: Tue, 28 Feb 2023 11:03:08 -0800 Message-ID: Subject: Re: Having trouble using JAX-RS annotation in Kawa Scheme class To: Arvydas Silanskas Cc: kawa@sourceware.org Content-Type: multipart/alternative; boundary="000000000000adc46805f5c73f60" X-Spam-Status: No, score=0.0 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: --000000000000adc46805f5c73f60 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Arvydas, Adding the explicit value: still results in the "annotation value must be a constant" error. I tried building Kawa from a git clone with Ant, but that too is failing. I errors out during build of srfi14.scm due to a missing file: char-tables.iscm I'm open to suggestions, but I'll just try to work around this issue for the time being. Thanks, Ross On Tue, Feb 28, 2023 at 9:37=E2=80=AFAM Arvydas Silanskas < nma.arvydas.silanskas@gmail.com> wrote: > 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 ty= pe >> 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 >> > --000000000000adc46805f5c73f60--