Coder Social home page Coder Social logo

C# Using JmesPath (1.0.308) Transform(string json, string expression) does not filter on integers when using `tick` delimiter. about jmespath.net HOT 2 CLOSED

jdevillard avatar jdevillard commented on June 18, 2024
C# Using JmesPath (1.0.308) Transform(string json, string expression) does not filter on integers when using `tick` delimiter.

from jmespath.net.

Comments (2)

springcomp avatar springcomp commented on June 18, 2024

Hi @Arrouusmith I cannot reproduce this error

Can you double check with:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net6.0</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="JmesPath.Net" Version="1.0.308" />
  </ItemGroup>

</Project>
using DevLab.JmesPath;

if (args.Length == 0)
{
    Console.Error.WriteLine("Missing required JMESPath expression.");
    Environment.Exit(42);
}

var expression = args[0];

var stdin = Console.In;
var stdout = Console.Out;

var text = stdin.ReadToEnd();

var jp = new JmesPath();
var token = jp.Transform(text, expression);

stdout.WriteLine(token);

And the following commands:

Set-Content -Path file.json -Value '[{"Id":"ab9d98d3-f163-44b4-bb6a-739a82139208","SupportCode":"031eb155-cc36-460a-ad6b-164f9b4fd0f8","TicketNumber":1}]'
cat file.json | dotnet run -- "[?TicketNumber==``1``].SupportCode | [0]"

from jmespath.net.

Arrouusmith avatar Arrouusmith commented on June 18, 2024

Hi, yes, you are quite right. I have gone back through my system and found that I have been corrupting the format of the string immediately before running the expression over it. My bad and thank you for your time.

from jmespath.net.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.