Grades from Desire2Learn - desire2learn

I using the following API to get grades:
For testing, I've hardcoded in the OrgId for a course that exists in our
Test environment.
uri = userContext.createAuthenticatedUri("/d2l/api/le/1.0/61782/grades/", "GET");
However, when I execute this call, I get the data returned below. It is
the structure of the Grades, but not the Grades themselves. How do I
get the actual grades for all the students, or what parameters am I missing?
[
{
"MaxPoints":25.000000000,
"CanExceedMaxPoints":false,
"IsBonus":false,
"ExcludeFromFinalGradeCalculation":false,
"GradeSchemeId":0,
"Id":89242,
"Name":"Quiz #1",
"ShortName":"",
"GradeType":"Numeric",
"CategoryId":93744,
"Description":{
"Text":"",
"Html":""
}
},
{
"MaxPoints":25.000000000,
"CanExceedMaxPoints":false,
"IsBonus":false,
"ExcludeFromFinalGradeCalculation":false,
"GradeSchemeId":null,
"Id":89243,
"Name":"Quiz #2",
"ShortName":"",
"GradeType":"Numeric",
"CategoryId":93744,
"Description":{
"Text":"",
"Html":""
}
},
{
"MaxPoints":25.000000000,
"CanExceedMaxPoints":false,
"IsBonus":false,
"ExcludeFromFinalGradeCalculation":false,
"GradeSchemeId":null,
"Id":89244,
"Name":"Quiz #3",
"ShortName":"",
"GradeType":"Numeric",
"CategoryId":93744,
"Description":{
"Text":"",
"Html":""
}
},
{
"MaxPoints":10.000000000,
"CanExceedMaxPoints":false,
"IsBonus":false,
"ExcludeFromFinalGradeCalculation":false,
"GradeSchemeId":0,
"Id":89245,
"Name":"Assignment 1",
"ShortName":"",
"GradeType":"Numeric",
"CategoryId":0,
"Description":{
"Text":"",
"Html":""
}
},
{
"MaxPoints":10.000000000,
"CanExceedMaxPoints":false,
"IsBonus":false,
"ExcludeFromFinalGradeCalculation":false,
"GradeSchemeId":null,
"Id":89246,
"Name":"Assignment 2",
"ShortName":"",
"GradeType":"Numeric",
"CategoryId":0,
"Description":{
"Text":"",
"Html":""
}
},
{
"MaxPoints":40.000000000,
"CanExceedMaxPoints":false,
"IsBonus":false,
"ExcludeFromFinalGradeCalculation":false,
"GradeSchemeId":null,
"Id":89247,
"Name":"Midterm",
"ShortName":"",
"GradeType":"Numeric",
"CategoryId":0,
"Description":{
"Text":"",
"Html":""
}
},
{
"MaxPoints":106.000000000,
"CanExceedMaxPoints":false,
"IsBonus":false,
"ExcludeFromFinalGradeCalculation":false,
"GradeSchemeId":null,
"Id":89248,
"Name":"Final Exam",
"ShortName":"",
"GradeType":"Numeric",
"CategoryId":0,
"Description":{
"Text":"",
"Html":""
}
},
{
"Id":94859,
"Name":"Lec Sect",
"ShortName":"",
"GradeType":"Text",
"CategoryId":0,
"Description":{
"Text":"",
"Html":""
}
}
]

The call I expect you want is grades in an org unit by user from the grade values (actions and data structures) area of the docs.
You will need to iterate this call over the classlist of ids.
(A walk through and code snippets are available on the blog)

Related

Slack view_submission Payload block_ids

I'm trying to get the submitted data from a slack modal payload (using Integromat) but I'm unable to match the fields as the field names (block_ids) and random and change on each submission.
Not sure where to start, is there something on the Slack side I can do to stop this or how can I handle this in Integromat?
Payload below:
{
"blocks":[
{
"type":"header",
"block_id":"GH6Wh",
"text":{
"type":"plain_text",
"text":"AHome",
"emoji":true
}
},
{
"type":"input",
"block_id":"ayv5",
"label":{
"type":"plain_text",
"text":"Project Title",
"emoji":true
},
"optional":false,
"dispatch_action":false,
"element":{
"type":"plain_text_input",
"action_id":"field_project_title",
"dispatch_action_config":{
"trigger_actions_on":[
"on_enter_pressed"
]
}
}
},
{
"type":"input",
"block_id":"4Tf7",
"label":{
"type":"plain_text",
"text":"Client Project Contacts",
"emoji":true
},
"optional":false,
"dispatch_action":false,
"element":{
"type":"multi_static_select",
"action_id":"client_project_contacts",
"placeholder":{
"type":"plain_text",
"text":"Select",
"emoji":true
},
"options":[
{
"text":{
"type":"plain_text",
"text":"jennifer",
"emoji":true
},
"value":"47dht5f-1942-4448-9842-20fef64dcd67"
}
]
}
},
{
"type":"divider",
"block_id":"a=6G"
},
{
"type":"section",
"block_id":"qtq0W",
"text":{
"type":"mrkdwn",
"text":"Project Start",
"verbatim":false
},
"accessory":{
"type":"datepicker",
"action_id":"field_project_start_date",
"initial_date":"2022-01-19",
"placeholder":{
"type":"plain_text",
"text":"Select a date",
"emoji":true
}
}
},
{
"type":"section",
"block_id":"4YOTI",
"text":{
"type":"mrkdwn",
"text":"Project Finish",
"verbatim":false
},
"accessory":{
"type":"datepicker",
"action_id":"field_project_end_date",
"initial_date":"2022-03-19",
"placeholder":{
"type":"plain_text",
"text":"Select a date",
"emoji":true
}
}
},
{
"type":"divider",
"block_id":"MZU"
},
{
"type":"input",
"block_id":"v09",
"label":{
"type":"plain_text",
"text":"Project Manager",
"emoji":true
},
"optional":false,
"dispatch_action":false,
"element":{
"type":"static_select",
"action_id":"field_project_managers",
"placeholder":{
"type":"plain_text",
"text":"Select",
"emoji":true
},
"options":[
{
"text":{
"type":"plain_text",
"text":"Eric ",
"emoji":true
},
"value":"b85ba51b-2346-481f-98a8-2b94fh994575"
}
]
}
},
{
"type":"input",
"block_id":"gxN9",
"label":{
"type":"plain_text",
"text":"Project Team",
"emoji":true
},
"optional":false,
"dispatch_action":false,
"element":{
"type":"multi_static_select",
"action_id":"field_project_team",
"placeholder":{
"type":"plain_text",
"text":"Select",
"emoji":true
},
"options":[
]
}
},
{
"type":"divider",
"block_id":"CU1k"
},
{
"type":"input",
"block_id":"ows",
"label":{
"type":"plain_text",
"text":"Setup apps",
"emoji":true
},
"optional":true,
"dispatch_action":false,
"element":{
"type":"checkboxes",
"action_id":"setup_apps",
"options":[
{
"text":{
"type":"plain_text",
"text":"Harvest",
"emoji":true
},
"value":"setup_harvest"
},
{
"text":{
"type":"plain_text",
"text":"Dropbox Project Folder",
"emoji":true
},
"value":"setup_dropbox"
}
]
}
},
{
"type":"divider",
"block_id":"Eov"
}
],
"private_metadata":"",
"callback_id":"_project_setup_form_submit",
"state":{
"values":{
"ayv5":{
"field_project_title":{
"type":"plain_text_input",
"value":"cvgf"
}
},
"4Tf7":{
"client_project_contacts":{
"type":"multi_static_select",
"selected_options":[
{
"text":{
"type":"plain_text",
"text":"Jennifer",
"emoji":true
},
"value":"04a96f00-c84d-403c-992f-28fgh34b7ade"
}
]
}
},
"qtq0W":{
"field_project_start_date":{
"type":"datepicker",
"selected_date":"2022-01-19"
}
},
"4YOTI":{
"field_project_end_date":{
"type":"datepicker",
"selected_date":"2022-03-19"
}
},
"v09":{
"field_project_managers":{
"type":"static_select",
"selected_option":{
"text":{
"type":"plain_text",
"text":"Eric",
"emoji":true
},
"value":"b85ba51b-2346-481f-9sa8-2b9468994575"
}
}
},
"gxN9":{
"field_project_team":{
"type":"multi_static_select",
"selected_options":[
{
"text":{
"type":"plain_text",
"text":"Elliot",
"emoji":true
},
"value":"94c4b483-fbg8-4211-971d-38cf615fdc5e"
}
]
}
},
"ows":{
"setup_apps":{
"type":"checkboxes",
"selected_options":[
{
"text":{
"type":"plain_text",
"text":"Harvest",
"emoji":true
},
"value":"setup_harvest"
}
]
}
}
}
}
}
When creating a view, you can (but aren't required to) specify a "block_id" as a property for each block. When an ID isn't provided, it seems to be randomly-generated each time.
Example:
{
"type": "modal",
"callback_id": "modal-identifier",
"title": {
"type": "plain_text",
"text": "Just a modal"
},
"blocks": [
{
"type": "section",
"block_id": "section-identifier",
"text": {
"type": "mrkdwn",
"text": "*Welcome* to ~my~ Block Kit _modal_!"
},
"accessory": {
"type": "button",
"block_id": "just-a-button",
"text": {
"type": "plain_text",
"text": "Just a button",
},
"action_id": "button-identifier",
}
}
],
}
Source, and I added a second "block_id" for the button.

elastic - QueryingParsingException - query does not support - when searching by association field using a filter

I have a model person that has many addresses (association/table name person_addresses)
I am trying to give the user the ability to find a person by its address.
When I try to search by address, I get: QueryingParsingException - query does not support [addresses.address]
e.g: /api/v1/search/people?q=aaron&address=scarborough
query:
[
{
"query":{
"match":{
"name":"aaron"
}
},
"sort":[
{
"id":{
"order":"desc"
}
}
],
"filter":{
"bool":{
"must":{
"nested":{
"path":"addresses",
"query":{
"terms":{
"addresses.address":"scarborough"
}
}
}
}
}
},
"aggregations":{
"addresses":{
"nested":{
"path":"addresses"
},
"aggregations":{
"nested_items":{
"terms":{
"field":"addresses.address",
"order":{
"_count":"desc"
}
}
}
}
}
}
}
]
mapping:
mapping do
indexes :first_name, type: 'multi_field', fields: {
first_name: { type: 'string', index: 'analyzed' },
na_first_name: { type: 'string', index: 'not_analyzed' }
}
indexes :middle_name, type: 'multi_field', fields: {
middle_name: { type: 'string', index: 'analyzed' },
na_middle_name: { type: 'string', index: 'not_analyzed' }
}
indexes :last_name, type: 'multi_field', fields: {
last_name: { type: 'string', index: 'analyzed' },
na_last_name: { type: 'string', index: 'not_analyzed' }
}
indexes :addresses, type: :nested do
indexes :location, type: :geo_point, index: :not_analyzed
indexes :country, type: :string, index: :not_analyzed
indexes :state, type: :string, index: :not_analyzed
indexes :address, type: :string
indexes :county, type: :string, index: :not_analyzed
indexes :city, type: :string, index: :not_analyzed
indexes :zip, type: :string, index: :not_analyzed
indexes :state_id, type: :long
indexes :county_id, type: :long
indexes :city_id, type: :long
end
end
I have this record indexed:
{
"_index": "pl_people",
"_type": "person",
"_id": "813106",
"_score": null,
"sort": [
-9223372036854775808
],
"resource": "Person",
"parameterized": "813106-aaron-mcguire",
"name": "Aaron McGuire",
"phone": "813-689-6889",
"date_of_birth": "1991-03-01",
"first_name": "Aaron",
"last_name": "McGuire",
"addresses": [
{
"id": 1,
"parameterized": "1",
"address": "123 Scarborough road",
"zip": "L5A2A9",
"city": "Ontario",
"country": "USA",
"state": "California",
"location": null,
"state_id": null,
"county_id": null,
"city_id": null
}
],
"projects": [],
}
index.json.jbuilder:
# frozen_string_literal: true
json.query do
if #term.present?
json.set!(:match, #field => #term)
else
json.set!(:match_all, {})
end
end
json.sort do
json.child! do
json.set!(:id, order: 'desc')
end
end
if [#address].any?(&:present?)
json.filter do
json.partial!('people/index/filters')
end
end
json.aggregations do
json.addresses do
json.nested do
json.set!(:path, 'addresses')
end
json.aggregations do
json.nested_items do
json.terms do
json.set!(:field, 'addresses.address')
json.set!(:order, _count: 'desc')
end
end
end
end
end
_filters.json.jbuilder:
# frozen_string_literal: true
json.bool do
json.must do
if (value = #address).present?
json.nested do
json.path('addresses')
json.query do
json.set!(:terms, 'addresses.address' => value)
end
end
end
end
end
index.rb (person search)
# frozen_string_literal: true
module Searching
module People
class Index < ::Searching::ApplicationSearching
self.valid_params = {
q: { type: :string, on_blank: :remove },
}
delegate :aggregations, to: :results
def initialize(params = {})
super(params)
end
protected
def klass
Person
end
def search
#search ||= ClientSearch.new(
index: [klass].map(&:index_name).join(','),
body: body,
size: limit,
from: offset,
)
end
def body
query_field = params[:field].present? ? params[:field] : :name
Searching::TemplateHandler.(
'people/index',
term: Searching::Util.sanitize_string(params[:q]),
field: query_field,
address: params[:address],
)
end
end
end
end
GET /pl_people
{
"pl_people":{
"aliases":{
},
"mappings":{
"person":{
"properties":{
"ac_name":{
"type":"string",
"analyzer":"autocomplete"
},
"addresses":{
"type":"nested",
"properties":{
"address":{
"type":"string"
},
"city":{
"type":"string",
"index":"not_analyzed"
},
"city_id":{
"type":"long"
},
"country":{
"type":"string",
"index":"not_analyzed"
},
"county":{
"type":"string",
"index":"not_analyzed"
},
"county_id":{
"type":"long"
},
"id":{
"type":"long"
},
"location":{
"type":"geo_point"
},
"parameterized":{
"type":"string"
},
"state":{
"type":"string",
"index":"not_analyzed"
},
"state_id":{
"type":"long"
},
"zip":{
"type":"string",
"index":"not_analyzed"
}
}
},
"author":{
"type":"string",
"index":"not_analyzed"
},
"body":{
"type":"string",
"analyzer":"remove_html",
"fields":{
"ns_body":{
"type":"string",
"analyzer":"remove_html_stopwords"
}
}
},
"charities":{
"type":"nested",
"properties":{
"email":{
"type":"string",
"index":"not_analyzed"
},
"id":{
"type":"long"
}
}
},
"community":{
"properties":{
"name":{
"type":"string",
"index":"not_analyzed"
},
"parameterized":{
"type":"string",
"index":"not_analyzed"
},
"slug":{
"type":"string",
"index":"not_analyzed"
}
}
},
"created_at":{
"type":"date",
"format":"dateOptionalTime"
},
"date_of_birth":{
"type":"date",
"format":"dateOptionalTime"
},
"description":{
"type":"string"
},
"employments":{
"type":"nested",
"properties":{
"email":{
"type":"string",
"index":"not_analyzed"
},
"employment_status":{
"type":"string",
"index":"not_analyzed"
},
"foia_contact":{
"type":"boolean"
},
"id":{
"type":"long"
},
"phone":{
"type":"string",
"index":"not_analyzed"
},
"phone_extension":{
"type":"string",
"index":"not_analyzed"
}
}
},
"first_name":{
"type":"string",
"fields":{
"na_first_name":{
"type":"string",
"index":"not_analyzed"
}
}
},
"last_name":{
"type":"string",
"fields":{
"na_last_name":{
"type":"string",
"index":"not_analyzed"
}
}
},
"market":{
"properties":{
"name":{
"type":"string",
"index":"not_analyzed"
},
"parameterized":{
"type":"string",
"index":"not_analyzed"
},
"slug":{
"type":"string",
"index":"not_analyzed"
}
}
},
"middle_name":{
"type":"string",
"fields":{
"na_middle_name":{
"type":"string",
"index":"not_analyzed"
}
}
},
"most_recent_organization":{
"properties":{
"description":{
"type":"string"
},
"id":{
"type":"long"
},
"name":{
"type":"string"
},
"parameterized":{
"type":"string"
},
"phone":{
"type":"string"
}
}
},
"name":{
"type":"string",
"fields":{
"na_name":{
"type":"string",
"index":"not_analyzed"
},
"ngram_name":{
"type":"string",
"analyzer":"my_start"
},
"ns_name":{
"type":"string",
"analyzer":"no_stopwords"
}
}
},
"organizations":{
"properties":{
"name":{
"type":"string"
},
"parameterized":{
"type":"string",
"index":"not_analyzed"
}
}
},
"package":{
"properties":{
"name":{
"type":"string",
"index":"not_analyzed"
},
"parameterized":{
"type":"string",
"index":"not_analyzed"
},
"slug":{
"type":"string",
"index":"not_analyzed"
}
}
},
"parameterized":{
"type":"string",
"index":"not_analyzed"
},
"phone":{
"type":"string"
},
"photo":{
"properties":{
"large":{
"type":"string"
},
"medium":{
"type":"string"
},
"teaser":{
"type":"string"
},
"thumb":{
"type":"string"
},
"url":{
"type":"string"
}
}
},
"projects":{
"properties":{
"id":{
"type":"long"
},
"name":{
"type":"string",
"index":"not_analyzed"
},
"parameterized":{
"type":"string",
"index":"not_analyzed"
},
"slug":{
"type":"string",
"index":"not_analyzed"
}
}
},
"public_offices":{
"type":"nested",
"properties":{
"email":{
"type":"string",
"index":"not_analyzed"
},
"employment_status":{
"type":"string",
"index":"not_analyzed"
},
"id":{
"type":"long"
}
}
},
"published":{
"type":"string",
"index":"not_analyzed"
},
"region":{
"properties":{
"name":{
"type":"string",
"index":"not_analyzed"
},
"parameterized":{
"type":"string",
"index":"not_analyzed"
},
"slug":{
"type":"string",
"index":"not_analyzed"
}
}
},
"resource":{
"type":"string"
},
"short_description":{
"type":"string"
},
"show_path":{
"type":"string"
},
"time":{
"type":"date",
"format":"dateOptionalTime"
},
"updated_at":{
"type":"date",
"format":"dateOptionalTime"
}
}
}
},
"settings":{
"index":{
"creation_date":"1581684793139",
"analysis":{
"filter":{
"english_stop":{
"type":"stop",
"stopwords":[
"a",
"an",
"and",
"are",
"as",
"at",
"be",
"but",
"by",
"for",
"if",
"in",
"into",
"is",
"it",
"no",
"not",
"of",
"on",
"or",
"such",
"that",
"the",
"their",
"then",
"there",
"these",
"they",
"this",
"to",
"was",
"with"
]
},
"my_edge":{
"min_gram":"2",
"side":"front",
"type":"edgeNGram",
"max_gram":"18"
}
},
"analyzer":{
"no_stopwords":{
"type":"stop",
"stopwords":"_english_"
},
"comma":{
"pattern":",",
"type":"pattern"
},
"default":{
"filter":[
"standard",
"lowercase",
"english_stop",
"word_delimiter"
],
"tokenizer":"standard"
},
"remove_html_stopwords":{
"filter":"stop",
"char_filter":"html_strip",
"type":"custom",
"stopwords":"_english_",
"tokenizer":"lowercase"
},
"autocomplete":{
"filter":[
"lowercase",
"apostrophe"
],
"tokenizer":"keyword"
},
"my_start":{
"filter":[
"asciifolding",
"lowercase",
"my_edge"
],
"tokenizer":"whitespace"
},
"remove_html":{
"filter":"lowercase",
"char_filter":"html_strip",
"type":"custom",
"tokenizer":"standard"
}
}
},
"number_of_shards":"5",
"number_of_replicas":"1",
"version":{
"created":"1070699"
},
"uuid":"LZrnPjxiTwyNf-Ggo3bXtw"
}
},
"warmers":{
}
}
}
Any naming conventions I am not following?
I tried changing person_address for address on filters.json and index.json, but still didnt have any success.
So i reinstall es 1.7 and made some try, simplified your data.
the error was in the "terms" in the filter, you have to use a term / match instead. If you want to add multiple condition it seems you need to build boolean query with a term on each.
Moreover i cant understand why you use a post_filter here (filter at top level = post_filter in es > 2.X), can you explain it?
This is what i done using HEAD if you want reproduce (i simplify the mappings, keeping only relevant fields).
hope it s help.
http://localhost:9200/pl_people/ (POST)
{
"mappings":{
"person":{
"properties":{
"ac_name":{
"type":"string"
},
"addresses":{
"type":"nested",
"properties":{
"address":{
"type":"string"
},
"city":{
"type":"string",
"index":"not_analyzed"
},
"city_id":{
"type":"long"
},
"country":{
"type":"string",
"index":"not_analyzed"
},
"county":{
"type":"string",
"index":"not_analyzed"
},
"county_id":{
"type":"long"
},
"id":{
"type":"long"
},
"location":{
"type":"geo_point"
},
"parameterized":{
"type":"string"
},
"state":{
"type":"string",
"index":"not_analyzed"
},
"state_id":{
"type":"long"
},
"zip":{
"type":"string",
"index":"not_analyzed"
}
}
},
"date_of_birth":{
"type":"date",
"format":"dateOptionalTime"
},
"first_name":{
"type":"string",
"fields":{
"na_first_name":{
"type":"string",
"index":"not_analyzed"
}
}
},
"last_name":{
"type":"string",
"fields":{
"na_last_name":{
"type":"string",
"index":"not_analyzed"
}
}
},
"name":{
"type":"string",
"fields":{
"na_name":{
"type":"string",
"index":"not_analyzed"
},
"ngram_name":{
"type":"string"
},
"ns_name":{
"type":"string"
}
}
},
"parameterized":{
"type":"string",
"index":"not_analyzed"
},
"phone":{
"type":"string"
},
"resource":{
"type":"string"
}
}
}
}
}
http://localhost:9200/pl_people/person/813106 (POST)
{
"ac_name": "Aaron McGuire",
"resource": "Person",
"parameterized": "813106-aaron-mcguire",
"name": "Aaron McGuire",
"phone": "813-689-6889",
"date_of_birth": "1991-03-01",
"first_name": "Aaron",
"last_name": "McGuire",
"addresses": [
{
"id": 1,
"parameterized": "1",
"address": "123 Scarborough road",
"zip": "L5A2A9",
"city": "Ontario",
"country": "USA",
"state": "California"
}
]
}
http://localhost:9200/pl_people/person/_search/ (post)
{
"query": {
"match": {
"name": "aaron"
}
},
"sort": [
{
"id": {
"order": "desc"
}
}
],
"filter": {
"bool": {
"must": {
"nested": {
"path": "addresses",
"query": {
"term": {
"addresses.address": "scarborough"
}
}
}
}
}
},
"aggregations": {
"addresses": {
"nested": {
"path": "addresses"
},
"aggregations": {
"nested_items": {
"terms": {
"field": "addresses.address",
"order": {
"_count": "desc"
}
}
}
}
}
}
}

Why does Java client generation fail in Swagger Editor?

I just tried to create a Java for my JSON Swagger file within the Swagger Editor.
Unfortunately nothing happens if I try to generate the client.
In the Dev-Tools console of Chrome I can see an exception but I do not have any idea what went wrong and where to find more detailed information.
POST https://generator.swagger.io/api/gen/clients/java 500 (Request failed.)
index.js:1 Uncaught (in promise) Error: Request failed.
at index.js:1
at tryCatch (runtime.js:62)
at Generator.invoke [as _invoke] (runtime.js:296)
at Generator.e.(/anonymous function) [as next] (https://editor.swagger.io/dist/swagger-editor-standalone-preset.js:1:104152)
at step (asyncToGenerator.js:17)
at asyncToGenerator.js:28
This is the JSON file used to generated the Java client:
{
"swagger":"2.0",
"info":{
"description":"REST API zur Anlage und Modifikation der Daten",
"title":"Aktivierung / Aktualisierung / Deaktivierung der Daten",
"version":"1"
},
"host":"myhost.server.local:8080",
"basePath":"/metadata-webapp",
"paths":{
"/metadata/deactivate":{
"put":{
"summary":"Metadata Deactivation",
"description":"",
"operationId":"deactivate",
"consumes":[
"application/json"
],
"produces":[
"application/json"
],
"parameters":[
{
"in":"body",
"name":"body",
"description":"metadata key",
"required":true,
"schema":{
"$ref":"#/definitions/MetadataKey"
}
}
],
"responses":{
"200":{
"description":"Request was processed"
},
"400":{
"description":"Bad Request, falls Validierung auf Request Objekt fehlschlägt"
},
"500":{
"description":"Interner Fehler"
}
}
}
},
"/metadata/individual":{
"post":{
"summary":"\tMetadata Insert Individual",
"description":"",
"operationId":"saveIndividual",
"consumes":[
"application/json"
],
"produces":[
"application/json"
],
"parameters":[
{
"in":"body",
"name":"body",
"description":"metadata",
"required":true,
"schema":{
"$ref":"#/definitions/MetadataIndividualInsert"
}
}
],
"responses":{
"200":{
"description":"OK"
},
"400":{
"description":"Invalid Metadata",
"schema":{
"$ref":"#/definitions/MetadataResponse"
}
},
"404":{
"description":"Not found",
"schema":{
"type":"string"
}
},
"405":{
"description":"Method Not Allowed",
"schema":{
"$ref":"#/definitions/MetadataResponse"
}
},
"409":{
"description":"Conflict",
"schema":{
"$ref":"#/definitions/MetadataResponse"
}
},
"500":{
"description":"Internal Server Error"
}
}
},
"put":{
"summary":"Metadata Update Individual",
"description":"",
"operationId":"updateIndividual",
"consumes":[
"application/json"
],
"produces":[
"application/json"
],
"parameters":[
{
"in":"body",
"name":"body",
"description":"metadata",
"required":true,
"schema":{
"$ref":"#/definitions/MetadataUpdate"
}
}
],
"responses":{
"200":{
"description":"Request was processed"
},
"400":{
"description":"Bad Request, falls Validierung auf Request Objekt fehlschlägt"
},
"500":{
"description":"Interner Fehler"
}
}
}
},
"/metadata":{
"post":{
"summary":"\tMetadata Insert",
"description":"",
"operationId":"save",
"consumes":[
"application/json"
],
"produces":[
"application/json"
],
"parameters":[
{
"in":"body",
"name":"body",
"description":"metadata",
"required":true,
"schema":{
"$ref":"#/definitions/MetadataInsert"
}
}
],
"responses":{
"200":{
"description":"OK"
},
"400":{
"description":"Invalid Metadata",
"schema":{
"$ref":"#/definitions/MetadataResponse"
}
},
"404":{
"description":"Not found",
"schema":{
"type":"string"
}
},
"405":{
"description":"Method Not Allowed",
"schema":{
"$ref":"#/definitions/MetadataResponse"
}
},
"409":{
"description":"Conflict",
"schema":{
"$ref":"#/definitions/MetadataResponse"
}
},
"500":{
"description":"Internal Server Error"
}
}
},
"put":{
"summary":"Metadata Update",
"description":"",
"operationId":"update",
"consumes":[
"application/json"
],
"produces":[
"application/json"
],
"parameters":[
{
"in":"body",
"name":"body",
"description":"metadata",
"required":true,
"schema":{
"$ref":"#/definitions/MetadataUpdate"
}
}
],
"responses":{
"200":{
"description":"Request was processed"
},
"400":{
"description":"Bad Request, falls Validierung auf Request Objekt fehlschlägt"
},
"500":{
"description":"Interner Fehler"
}
}
}
}
},
"definitions":{
"MetadataKey":{
"type":"object",
"required":[
"itemId"
],
"properties":{
"itemId":{
"type":"string",
"minLength":1,
"maxLength":36
},
"itemCode":{
"type":"string",
"minLength":0,
"maxLength":10
}
}
},
"MetadataResponse":{
"type":"object",
"required":[
"itemId"
],
"properties":{
"itemId":{
"type":"string",
"minLength":1,
"maxLength":36
},
"itemCode":{
"type":"string",
"minLength":0,
"maxLength":10
},
"returnCode":{
"type":"string",
"enum":[
"OK",
"FAULT",
"IRRELEVANT",
"STATUS",
"TECHNICAL_ERROR"
]
},
"message":{
"type":"string"
}
}
},
"MetadataUpdate":{
"type":"object",
"required":[
"aType",
"codeFrom",
"iType",
"isCodeRangeNumeric",
"lengthOfCodes",
"numberOfCodes",
"oCategory",
"itemId",
"myExtraIds",
"status",
"targetCategory",
"validDays",
"validFrom",
"validUntil"
],
"properties":{
"itemId":{
"type":"string",
"minLength":1,
"maxLength":36
},
"itemCode":{
"type":"string",
"minLength":0,
"maxLength":10
},
"uuid":{
"type":"string"
},
"validFrom":{
"type":"string",
"format":"date-time",
"example":"yyyy-MM-dd'T'HH:mm:ssZ"
},
"validUntil":{
"type":"string",
"format":"date-time",
"example":"yyyy-MM-dd'T'HH:mm:ssZ"
},
"validUntilOriginal":{
"type":"string",
"format":"date-time"
},
"validDays":{
"type":"integer",
"format":"int32"
},
"visibleFrom":{
"type":"string",
"format":"date-time",
"example":"yyyy-MM-dd'T'HH:mm:ssZ"
},
"visibleTo":{
"type":"string",
"format":"date-time",
"example":"yyyy-MM-dd'T'HH:mm:ssZ"
},
"aType":{
"type":"integer",
"format":"int32",
"description":"OFFLINE(1),ONLINE(2),BOTH(3)"
},
"multiRedeem":{
"type":"integer",
"format":"int32",
"minimum":1,
"maximum":2147483647
},
"targetCategory":{
"type":"integer",
"format":"int32",
"description":"desc"
},
"iType":{
"type":"integer",
"format":"int32",
"description":"desc"
},
"oCategory":{
"type":"integer",
"format":"int32",
"description":"desc"
},
"incentiveValueFrom":{
"type":"integer",
"format":"int32"
},
"incentiveValueTo":{
"type":"integer",
"format":"int32"
},
"externalID":{
"type":"string"
},
"couponID":{
"type":"string"
},
"codeFrom":{
"type":"string",
"minLength":1,
"maxLength":2147483647
},
"codeTo":{
"type":"string"
},
"infoText":{
"type":"string"
},
"status":{
"type":"integer",
"format":"int32",
"description":"desc"
},
"numberOfCodes":{
"type":"integer",
"format":"int32",
"minimum":1,
"maximum":2147483647
},
"lengthOfCodes":{
"type":"integer",
"format":"int32",
"minimum":4,
"maximum":2147483647
},
"isCodeRangeNumeric":{
"type":"boolean"
},
"interfaceOrigin":{
"type":"integer",
"format":"int32",
"description":"desc"
},
"myExtraIds":{
"type":"array",
"items":{
"type":"string"
},
"maxItems":2147483647,
"minItems":1
}
}
},
"MetadataIndividualInsert":{
"type":"object",
"required":[
"aType",
"codeFrom",
"iType",
"isCodeRangeNumeric",
"lengthOfCodes",
"numberOfCodes",
"oCategory",
"itemId",
"myExtraIds",
"status",
"targetCategory",
"validDays",
"validFrom",
"validUntil"
],
"properties":{
"itemId":{
"type":"string",
"minLength":1,
"maxLength":36
},
"itemCode":{
"type":"string",
"minLength":0,
"maxLength":10
},
"uuid":{
"type":"string"
},
"validFrom":{
"type":"string",
"format":"date-time",
"example":"yyyy-MM-dd'T'HH:mm:ssZ"
},
"validUntil":{
"type":"string",
"format":"date-time",
"example":"yyyy-MM-dd'T'HH:mm:ssZ"
},
"validUntilOriginal":{
"type":"string",
"format":"date-time"
},
"validDays":{
"type":"integer",
"format":"int32"
},
"visibleFrom":{
"type":"string",
"format":"date-time",
"example":"yyyy-MM-dd'T'HH:mm:ssZ"
},
"visibleTo":{
"type":"string",
"format":"date-time",
"example":"yyyy-MM-dd'T'HH:mm:ssZ"
},
"aType":{
"type":"integer",
"format":"int32",
"description":"OFFLINE(1),ONLINE(2),BOTH(3)"
},
"multiRedeem":{
"type":"integer",
"format":"int32",
"minimum":1,
"maximum":2147483647
},
"targetCategory":{
"type":"integer",
"format":"int32",
"description":"desc"
},
"iType":{
"type":"integer",
"format":"int32",
"description":"desc"
},
"oCategory":{
"type":"integer",
"format":"int32",
"description":"desc"
},
"incentiveValueFrom":{
"type":"integer",
"format":"int32"
},
"incentiveValueTo":{
"type":"integer",
"format":"int32"
},
"externalID":{
"type":"string"
},
"couponID":{
"type":"string"
},
"codeFrom":{
"type":"string",
"minLength":1,
"maxLength":2147483647
},
"codeTo":{
"type":"string"
},
"infoText":{
"type":"string"
},
"status":{
"type":"integer",
"format":"int32",
"description":"desc"
},
"numberOfCodes":{
"type":"integer",
"format":"int32",
"minimum":1,
"maximum":2147483647
},
"lengthOfCodes":{
"type":"integer",
"format":"int32",
"minimum":4,
"maximum":2147483647
},
"isCodeRangeNumeric":{
"type":"boolean"
},
"interfaceOrigin":{
"type":"integer",
"format":"int32",
"description":"desc"
},
"myExtraIds":{
"type":"array",
"items":{
"type":"string"
},
"maxItems":2147483647,
"minItems":1
}
}
},
"MetadataInsert":{
"type":"object",
"required":[
"aType",
"codeFrom",
"iType",
"isCodeRangeNumeric",
"lengthOfCodes",
"numberOfCodes",
"oCategory",
"itemId",
"myExtraIds",
"status",
"targetCategory",
"validDays",
"validFrom",
"validUntil"
],
"properties":{
"itemId":{
"type":"string",
"minLength":1,
"maxLength":36
},
"itemCode":{
"type":"string",
"minLength":0,
"maxLength":10
},
"uuid":{
"type":"string"
},
"validFrom":{
"type":"string",
"format":"date-time",
"example":"yyyy-MM-dd'T'HH:mm:ssZ"
},
"validUntil":{
"type":"string",
"format":"date-time",
"example":"yyyy-MM-dd'T'HH:mm:ssZ"
},
"validUntilOriginal":{
"type":"string",
"format":"date-time"
},
"validDays":{
"type":"integer",
"format":"int32"
},
"visibleFrom":{
"type":"string",
"format":"date-time",
"example":"yyyy-MM-dd'T'HH:mm:ssZ"
},
"visibleTo":{
"type":"string",
"format":"date-time",
"example":"yyyy-MM-dd'T'HH:mm:ssZ"
},
"aType":{
"type":"integer",
"format":"int32",
"description":"OFFLINE(1),ONLINE(2),BOTH(3)"
},
"multiRedeem":{
"type":"integer",
"format":"int32",
"minimum":1,
"maximum":2147483647
},
"targetCategory":{
"type":"integer",
"format":"int32",
"description":"desc"
},
"iType":{
"type":"integer",
"format":"int32",
"description":"desc"
},
"oCategory":{
"type":"integer",
"format":"int32",
"description":"desc"
},
"incentiveValueFrom":{
"type":"integer",
"format":"int32"
},
"incentiveValueTo":{
"type":"integer",
"format":"int32"
},
"externalID":{
"type":"string"
},
"couponID":{
"type":"string"
},
"codeFrom":{
"type":"string",
"minLength":1,
"maxLength":2147483647
},
"codeTo":{
"type":"string"
},
"infoText":{
"type":"string"
},
"status":{
"type":"integer",
"format":"int32",
"description":"desc"
},
"numberOfCodes":{
"type":"integer",
"format":"int32",
"minimum":1,
"maximum":2147483647
},
"lengthOfCodes":{
"type":"integer",
"format":"int32",
"minimum":4,
"maximum":2147483647
},
"isCodeRangeNumeric":{
"type":"boolean"
},
"interfaceOrigin":{
"type":"integer",
"format":"int32",
"description":"desc"
},
"myExtraIds":{
"type":"array",
"items":{
"type":"string"
},
"maxItems":2147483647,
"minItems":1
}
}
}
}
}
Does anybody can give my a hint what to do or where to look at?
The issue is caused by a very large maxItems value in array definitions in the spec:
"maxItems":2147483647
It causes an out-of-memory error in Swagger Codegen, see this issue for details.
The workaround is to remove maxItems from your spec.

Highcharts drilldown functionality is not working in angular using highcharts-ng directive

$scope.chartOptions = { [
{
"options":{
"chart":{
"plotBorderWidth":1,
"events":{
},
"zoomType":"xy",
"type":"column"
},
"legend":{
"enabled":true,
"floating":false,
"align":"left",
"maxHeight":60,
"itemWidth":100
},
"plotOptions":{
"line":{
"dataLabels":{
"enabled":true,
"color":"black",
"style":{
"fontSize":"8px"
}
},
"series":{
"color":"#FFFFFFF"
}
},
"column":{
"colorByPoint":true,
"dataLabels":{
"enabled":true,
"color":"black",
"style":{
"fontSize":"8px"
}
}
},
"area":{
"dataLabels":{
"enabled":true,
"color":"black",
"style":{
"fontSize":"8px"
}
}
},
"bar":{
"colorByPoint":true,
"dataLabels":{
"enabled":true,
"color":"black",
"style":{
"fontSize":"8px"
}
}
},
"spline":{
"dataLabels":{
"enabled":true,
"color":"black",
"style":{
"fontSize":"8px"
}
}
}
},
"exporting":{
"enabled":false
},
"yAxis":[
{
"labels":{
"style":{
"color":"#89A54E"
}
},
"title":{
"text":"SUM(AccountCodeAlternateKey)",
"events":{
}
},
"opposite":false,
"showEmpty":false
}
],
"tooltip":{
"headerFormat":"<b>{point.key}</b><br/>",
"pointFormat":"{series.name}: {point.y}<br/>"
}
},
"title":{
"text":"test_drilldown_col"
},
"xAxis":{
"labels":{
"useHTML":true,
"rotation":-90
},
"categories":[
"null",
"Assets",
"Balances",
"Expenditures",
"Flow",
"Liabilities",
"Revenue",
"Statistical"
],
"crosshair":true,
"useHTML":true,
"lineColor":"transparent",
"tickLength":0,
"title":{
"text":"AccountType",
"events":{
}
}
},
"yAxis":{
},
"drilldown":{
"series":[
{
"id":"Assets",
"data":[
[
"abc",
4
],
[
"xyz",
2
]
]
},
{
"id":"Flow",
"data":[
[
"Apples",
4
],
[
"Oranges",
2
]
]
},
{
"id":"Balances",
"data":[
[
"Toyota",
4
],
[
"Opel",
2
]
]
}
]
},
"plotOptions":{
"line":{
"dataLabels":{
"enabled":true,
"color":"black",
"style":{
"fontSize":"8px"
}
},
"series":{
"color":"#FFFFFFF"
}
},
"column":{
"colorByPoint":true,
"dataLabels":{
"enabled":true,
"color":"black",
"style":{
"fontSize":"8px"
}
}
},
"area":{
"dataLabels":{
"enabled":true,
"color":"black",
"style":{
"fontSize":"8px"
}
}
},
"bar":{
"colorByPoint":true,
"dataLabels":{
"enabled":true,
"color":"black",
"style":{
"fontSize":"8px"
}
}
},
"spline":{
"dataLabels":{
"enabled":true,
"color":"black",
"style":{
"fontSize":"8px"
}
}
}
},
"loading":false,
"series":[
{
"name":"SUM(AccountCodeAlternateKey)",
"data":[
{
"name":"Assets",
"y":23867,
"drilldown":"Assets"
},
{
"name":"Balances",
"y":28580,
"drilldown":"Balances"
},
{
"name":"Flow",
"y":191730,
"drilldown":"Flow"
}
],
"color":"#E3E75B"
}
]
}
] }
This is my dynamically generated json with the response from API, Done changes in highcharts-ng.js to support drilldown by following Highcharts-ng with drilldown
But still drilldown is not working.
Please suggest what changes still needs to be done.
And my $scope.chartOptions have multiple charts data also
Placeholder

Wrong colors are being displayed - Direct3D

So far I made a very basic cube, but the colors I use are wrong. If I define Red in my Vertex Buffer, then there is no red at all anywhere on the cube!
Red goes to Light Green
Yellow goes to Light Blue
....
Some colors like Green, Black, ... are find, just some of them!!
Here's how I define my Vertex Buffer (ignore the /*UV Coords*/)
Vertex vertices[] =
{
//Front face vertices
{ XMFLOAT3(-1.0f, +1.0f, +1.0f), /*XMFLOAT2(0.5f, 0.0f)*/ Colors::Yellow },
{ XMFLOAT3(+1.0f, +1.0f, +1.0f), /*XMFLOAT2(1.0f, 0.0f)*/ Colors::Yellow },
{ XMFLOAT3(-1.0f, -1.0f, +1.0f), /*XMFLOAT2(0.5f, 1.0f)*/ Colors::Yellow },
{ XMFLOAT3(+1.0f, -1.0f, +1.0f), /*XMFLOAT2(1.0f, 1.0f)*/ Colors::Yellow },
//Back face vertices
{ XMFLOAT3(-1.0f, +1.0f, -1.0f), /*XMFLOAT2(0.5f, 0.0f)*/ Colors::Yellow },
{ XMFLOAT3(+1.0f, +1.0f, -1.0f), /*XMFLOAT2(1.0f, 0.0f)*/ Colors::Yellow },
{ XMFLOAT3(-1.0f, -1.0f, -1.0f), /*XMFLOAT2(0.5f, 1.0f)*/ Colors::Yellow },
{ XMFLOAT3(+1.0f, -1.0f, -1.0f), /*XMFLOAT2(1.0f, 1.0f)*/ Colors::Yellow },
//Right face vertices
{ XMFLOAT3(+1.0f, +1.0f, -1.0f), /*XMFLOAT2(1.0f, 0.0f)*/ Colors::Yellow },
{ XMFLOAT3(+1.0f, -1.0f, -1.0f), /*XMFLOAT2(1.0f, 1.0f)*/ Colors::Yellow },
{ XMFLOAT3(+1.0f, +1.0f, +1.0f), /*XMFLOAT2(0.5f, 0.0f)*/ Colors::Yellow },
{ XMFLOAT3(+1.0f, -1.0f, +1.0f), /*XMFLOAT2(0.5f, 1.0f)*/ Colors::Yellow },
//Left face vertices
{ XMFLOAT3(-1.0f, +1.0f, -1.0f), /*XMFLOAT2(0.5f, 0.0f)*/ Colors::Yellow },
{ XMFLOAT3(-1.0f, -1.0f, -1.0f), /*XMFLOAT2(0.5f, 1.0f)*/ Colors::Yellow },
{ XMFLOAT3(-1.0f, +1.0f, +1.0f), /*XMFLOAT2(0.0f, 0.0f)*/ Colors::Yellow },
{ XMFLOAT3(-1.0f, -1.0f, +1.0f), /*XMFLOAT2(0.0f, 1.0f)*/ Colors::Yellow },
//Top face vertices
{ XMFLOAT3(+1.0f, +1.0f, -1.0f), /*XMFLOAT2(0.5f, 1.0f)*/ Colors::Yellow },
{ XMFLOAT3(-1.0f, +1.0f, -1.0f), /*XMFLOAT2(0.0f, 1.0f)*/ Colors::Yellow },
{ XMFLOAT3(+1.0f, +1.0f, +1.0f), /*XMFLOAT2(0.5f, 0.0f)*/ Colors::Yellow },
{ XMFLOAT3(-1.0f, +1.0f, +1.0f), /*XMFLOAT2(0.0f, 0.0f)*/ Colors::Yellow },
//Bottom face vertices
{ XMFLOAT3(+1.0f, -1.0f, -1.0f), /*XMFLOAT2(0.5f, 1.0f)*/ Colors::Yellow },
{ XMFLOAT3(-1.0f, -1.0f, -1.0f), /*XMFLOAT2(0.0f, 1.0f)*/ Colors::Yellow },
{ XMFLOAT3(+1.0f, -1.0f, +1.0f), /*XMFLOAT2(0.5f, 0.0f)*/ Colors::Yellow },
{ XMFLOAT3(-1.0f, -1.0f, +1.0f), /*XMFLOAT2(0.0f, 0.0f)*/ Colors::Yellow }
};
Here I tested it with only Yellow, the result:
Some info:
Vertex Structure:
struct Vertex
{
XMFLOAT3 pos;
XMVECTORF32 color;
};
The Colors Enum is from DirectXColors.h. It uses for the colors XMVECTORF32.
My really basic Pixel Shader:
struct PixelIN
{
float4 pos : SV_POSITION;
float4 color : COLOR;
};
float4 main(PixelIN i) : SV_TARGET
{
return i.color;
}
My Input Layout Description:
D3D11_INPUT_ELEMENT_DESC ie[] = {
{ "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "COLOR", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, 12, D3D11_INPUT_PER_VERTEX_DATA, 0}
};
BufferDesc.Format has the value of DXGI_FORMAT_R8G8B8A8_UNORM
Thanks for the help!
Your issue is a mixture of XMFLOAT3 and XMVECTORF32 in your Vertex structure which is inserting extra padding into the structure.
XMVECTOR types align to 16 byte boundaries for performance. This would make your Vertex structure 32 bytes with a 1 byte padding in between pos and color to properly align the XMVECTORF32 data. That extra byte of padding throws off your input layout because you've said the position is 12 bytes followed immediately by 16 bytes which is only 28 bytes.
You can fix that in a few ways. Either:
Change "POSITION" in your input layout to DXGI_FORMAT_R32G32B32A32_FLOAT to account for the extra byte of padding in your structure. If you are using a float4 for the position in your vertex shader, you might need to set this extra value (the w component) to 1 before transforming.
Change color in your structure to an XMFLOAT4.
Change pos in your structure to an XMVECTORF32 or XMFLOAT4 and do #1. This makes the padding not hidden.

Resources